This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / lib / scimath / arctanh

_ArrayFunctionDispatcher

numpy.lib.scimath:arctanh

source: build-install/usr/lib/python3.14/site-packages/numpy/lib/_scimath_impl.py :589

Signature

def   arctanh ( x )

Summary

Compute the inverse hyperbolic tangent of x.

Extended Summary

Return the "principal value" (for a description of this, see numpy.arctanh) of arctanh(x). For real x such that abs(x) < 1, this is a real number. If abs(x) > 1, or if x is complex, the result is complex. Finally, x = 1 returns``inf`` and x=-1 returns -inf.

Parameters

x : array_like

The value(s) whose arctanh is (are) required.

Returns

out : ndarray or scalar

The inverse hyperbolic tangent(s) of the x value(s). If x was a scalar so is out, otherwise an array is returned.

Notes

For an arctanh() that returns NAN when real x is not in the interval (-1,1), use numpy.arctanh (this latter, however, does return +/-inf for x = +/-1).

Examples

import numpy as np
np.set_printoptions(precision=4)
np.emath.arctanh(0.5)
import warnings
with warnings.catch_warnings():
    warnings.simplefilter('ignore', RuntimeWarning)
    np.emath.arctanh(np.eye(2))
np.emath.arctanh([1j])

See also

numpy.arctanh

Aliases

  • numpy.emath.arctanh