Calculate element-wise inverse of hyperbolic tangent of input.
JAX implementation of numpy.arctanh
.
The inverse of hyperbolic tangent is defined by:
\[arctanh(x) = \frac{1}{2} [\ln(1 + x) - \ln(1 - x)]\]
x (ArrayLike) – input array or scalar.
An array of same shape as x
containing the inverse of hyperbolic tangent of each element of x
, promoting to inexact dtype.
Note
jnp.arctanh
returns nan
for real-values outside the range [-1, 1]
.
jnp.arctanh
follows the branch cut convention of numpy.arctanh
for complex inputs.
Examples
>>> x = jnp.array([-2, -1, -0.5, 0, 0.5, 1, 2]) >>> with jnp.printoptions(precision=3, suppress=True): ... jnp.arctanh(x) Array([ nan, -inf, -0.549, 0. , 0.549, inf, nan], dtype=float32)
For complex-valued input:
>>> x1 = jnp.array([-2+0j, 3+0j, 4-1j]) >>> with jnp.printoptions(precision=3, suppress=True): ... jnp.arctanh(x1) Array([-0.549+1.571j, 0.347+1.571j, 0.239-1.509j], dtype=complex64)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3