The Python atanh function is used to calculate the Trigonometric Hyperbolic Arc Tangent for the specified expression or number. The atanh function is also called the inverse of hyperbolic Tangent.
In this section, we discuss how to use the atanh function in Python Programming language with an example. The syntax of the atanh Function is
math.atanh(number);
Number: A valid numerical expression to find the Hyperbolic Arc Tangent value.
- If the number argument is positive and negative, the atanh function returns the Hyperbolic Arc Tangent value.
- If it is not between -1 (exclude) and 1 (exclude), it returns ValueError.
- And if it is not a number, it returns TypeError.
Python atanh Function Example
The atanh Function allows you to find the Trigonometric Hyperbolic Arc Tangent of the numeric values. In this example, We will find the Hyperbolic Arc Tangent values of different data types.
TIP: Please refer to the Python tan function from the Python basics page to understand the Tangent Function.
import math
Tup = (0.10, 0.20, 0.35, -0.45 , 0.75)
Lis = [-0.15, 0.25, -0.32, -0.95 , 0.64]
print('Hyperbolic Arc Tangent of Positive Number = %.2f' %math.atanh(0.91))
print('Hyperbolic Arc Tangent of Negative Number = %.2f' %math.atanh(-0.91))
print('Hyperbolic Arc Tangent of Tuple Item = %.2f' %math.atanh(Tup[3]))
print('Hyperbolic Arc Tangent of List Item = %.2f' %math.atanh(Lis[2]))
print('Hyperbolic Arc Tangent of Multiple Numbers = %.2f' %math.atanh(0.22 + 0.49 - 0.27))
print('Hyperbolic Arc Tangent of String Value = ', math.atanh('Hello'))

First, We used directly on both the Positive and Negative values. The following statements find the hyperbolic arc Tangent of the corresponding values.
print('Hyperbolic Arc Tangent of Positive Number = %.2f' %math.atanh(0.91))
print('Hyperbolic Arc Tangent of Negative Number = %.2f' %math.atanh(-0.91))
TIP: You can try values greater than or equal to one, but it throws a ValueError. Please refer to the Python asinh and Python acosh functions from the list of Python math methods to find the arc sine and arc cosine values.
Next, We used the atanh Function on Tuple and List items. See the above Python screenshot, this Math function is working perfectly on Tuples in Python and Lists in Python.
print('Hyperbolic Arc Tangent of Tuple Item = %.2f' %math.atanh(Tup[3]))
print('Hyperbolic Arc Tangent of List Item = %.2f' %math.atanh(Lis[2]))
Next, We used the atanh method directly on multiple values.
print('Hyperbolic Arc Tangent of Multiple Numbers = %.2f' %math.atanh(0.22 + 0.49 - 0.27))
We tried on the String value, and it returns TypeError as output.
print('Hyperbolic Arc Tangent of String Value = ', math.atanh('Hello'))