## C++ atanh()

C++ atanh() returns arc (inverse) hyperbolic tangent of a number in radians.

### Syntax

The syntax of C++ atanh() is

`atanh(x)`

where

Returns

The return value depends on the type of value passed for parameter x.

The return value of atanh(x) is

• double if x is double.
• float if x is float.
• long double if x is long double.

The synopsis of atanh() function is

```double atanh(double x);
float atanh(float x);
long double atanh(long double x);
double atanh(T x); // For integral type```

atanh() is a function of cmath library. Include cmath library at start of the program, if using atanh() function.

### Example

In this example, we read a number from user into variable x, and find its inverse hyperbolic tangent value using atanh().

C++ Program

```#include <iostream>
#include<cmath>
using namespace std;

int main() {
double x;
cout << "Enter a number : ";
cin >> x;

double result = atanh(x);
cout << "atanh(" << x << ") : " << result << " radians" << endl;
}```

Output

```Enter a number : 0.5
Program ended with exit code: 0```
```Enter a number : -1
```Enter a number : 1
```Enter a number : 5