fn

arctanh

Tensor
arctanh(x: Tensor)
source

Inverse hyperbolic tangent.

Verbose alias of atanh. Computes arctanh(x)=12log ⁣((1+x)/(1x))\operatorname{arctanh}(x) = \tfrac{1}{2}\log\!\bigl((1+x)/(1-x)\bigr), defined for x<1|x| < 1.

Parameters

xTensor
Input tensor; element-wise values must satisfy x<1|x| < 1 for a finite real result.

Returns

Tensor

Element-wise inverse hyperbolic tangent, same shape as x.

Notes

Mathematical definition:

arctanh(x)=12log ⁣(1+x1x),x<1.\operatorname{arctanh}(x) = \tfrac{1}{2}\log\!\Bigl(\tfrac{1 + x}{1 - x}\Bigr), \qquad |x| < 1.

Boundary values x=±1x = \pm 1 produce ±\pm\infty; x>1|x| > 1 produces NaN. Derivative is 1/(1x2)1 / (1 - x^{2}). Both arctanh and atanh refer to the same composite.

Examples

>>> import lucid
>>> x = lucid.tensor([-0.5, 0.0, 0.5])
>>> lucid.arctanh(x)
Tensor([-0.5493,  0.    ,  0.5493])