
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
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 Articles
- 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
- Finding the Inverse Hyperbolic Tangent of Complex Number in Golang
- Finding the Inverse Hyperbolic Tangent of Specified Number in Golang
- How to compute the inverse cosine and inverse hyperbolic cosine in PyTorch?
- How to compute the inverse hyperbolic sine in PyTorch?
- Compute the Hyperbolic cosine in Python
- Compute the Hyperbolic sine in Python
- Get the Trigonometric inverse tangent in Python
