The cmath.atanh() function returns the inverse hyperbolic tangent of a number. The input number can be complex or real but the returned value is always a complex number.

cmath.atanh(x)
x The value(real or complex) whose inverse hyperbolic tangent we want.

The function returns a complex number representing the angle in radians whose hyperbolic tangent is .

import cmath

print(cmath.atanh(0.5))
print(cmath.atanh(-4))
print(cmath.atanh(1 + 2j))
print(cmath.atanh(-2 + 2j))