What is math.atanh() in Python?

The in-built atanh() function from the math module in Python is used to return the inverse hyperbolic tangent of a number in radians.

Figure 1 shows the mathematical representation of the atanh() function.

Figure 1: Logarithmic representation of inverse hyperbolic tangent function

Syntax

math.atanh(x)

Parameter

This function requires a positive or negative number between -0.99 and 0.99.

Return value

atanh(x) returns a float value that is the inverse hyperbolic tangent of the number sent as a parameter.

Example

import math
#Parameter as a positive number
print ("The value of atanh(0.3) is:", math.atanh(0.3))
#Parameter as a negative number
print ("The value of atanh(-0.9) is:", math.atanh(-0.9))

Free Resources