fn

atanh

Tensor
atanh(x: Tensor)
source

Inverse hyperbolic tangent.

Short-name alias of arctanh. Domain is the open interval (1,1)(-1, 1); values at the boundary diverge to ±\pm\infty.

Parameters

xTensor
Input tensor with values in x<1|x| < 1.

Returns

Tensor

Element-wise inverse hyperbolic tangent.

Notes

Mathematical definition:

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

Values outside (1,1)(-1, 1) produce NaN; x=±1x = \pm 1 produces ±\pm\infty. The derivative is 1/(1x2)1 / (1 - x^{2}).

Examples

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