Python math.atanh() - Arc / Inverse Hyperbolic Tangent
Python math.atanh()
math.atanh(x) function returns the hyperbolic tangent of x.
atanh(x) = 0.5*log( (1 + x) / (1 - x) )
Syntax
The syntax to call atanh() function is
math.atanh(x)
where
Parameter | Required | Description |
---|---|---|
x | Yes | A numeric value. The valid range of x is (-1, 1). |
If x is not a valid value for atanh() function, then the function raises ValueError.
Examples
In the following example, we find the inverse hyperbolic tangent of 0.5, using atanh() function of math module.
Python Program
import math
x = 0.5
result = math.atanh(x)
print('atanh(x) :', result)
Output
atanh(x) : 0.5493061443340549
Summary
In this Python Examples tutorial, we learned the syntax of, and examples for math.atanh() function.