- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Compute the inverse Hyperbolic tangent in Python

The arctanh is a multivalued function: for each x there are infinitely many numbers z such that tanh(z) = x. The convention is to return the z whose imaginary part lies in [-pi/2, pi/2]. The inverse hyperbolic tangent is also known as atanh or tanh^-1.

To compute the inverse Hyperbolic tangent, use the numpy.arctanh() method. The method returns the array of the same shape as x. This is a scalar if x is a scalar. The 1st parameter, x is input array. The 2nd and 3rd parameters are optional.

The 2nd parameter is an ndarray, A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned.

The 3rd parameter is the condition is broadcast over the input. At locations where the condition is True, the out array will be set to the ufunc result. Elsewhere, the out array will retain its original value.

## Steps

At first, import the required libraries −

import numpy as np

Find arctanh 0 −

print("\nResult...",np.arctanh(0))

Finding arctanh 0.3 −

print("\nResult...",np.arctanh(0.3))

Finding arctanh -0.3 −

print("\nResult...",np.arctanh(-0.3))

Finding arctanh 0.5 −

print("\nResult...",np.arctanh(0.5))

Finding arctanh 0.11 −

print("\nResult...",np.arctanh(0.11))

## Example

import numpy as np # The arctanh is a multivalued function: for each x there are infinitely many numbers z such that tanh(z) = x. The convention is to return the z whose imaginary part lies in [-pi/2, pi/2]. # The inverse hyperbolic tangent is also known as atanh or tanh^-1. print("Get the Trigonometric inverse Hyperbolic tangent...") # find arctanh 0 print("\nResult...",np.arctanh(0)) # finding arctanh 0.3 print("\nResult...",np.arctanh(0.3)) # finding arctanh -0.3 print("\nResult...",np.arctanh(-0.3)) # finding arctanh 0.5 print("\nResult...",np.arctanh(0.5)) # finding arctanh 0.11 print("\nResult...",np.arctanh(0.11))

## Output

Get the Trigonometric inverse Hyperbolic tangent... Result... 0.0 Result... 0.30951960420311175 Result... -0.30951960420311175 Result... 0.5493061443340548 Result... 0.11044691579009715

- Related Questions & Answers
- Compute the inverse hyperbolic tangent with scimath in Python
- Compute the inverse Hyperbolic tangent of array elements in Python
- Compute the Hyperbolic tangent in Python
- Compute the inverse Hyperbolic sine in Python
- Compute the inverse Hyperbolic cosine in Python
- Compute the Hyperbolic tangent of the array elements in Python
- Compute the inverse Hyperbolic sine of array elements in Python
- Compute the inverse Hyperbolic cosine of array elements in Python
- How to compute the inverse hyperbolic sine in PyTorch?
- How to compute the inverse cosine and inverse hyperbolic cosine in PyTorch?
- Get the Trigonometric inverse tangent in Python
- Compute the Hyperbolic cosine in Python
- Compute the Hyperbolic sine in Python
- Get the Trigonometric inverse tangent of the array elements in Python
- Compute the inverse cosine with scimath in Python