atanh
Compute the hyperbolic arc tangent value of a real number.
Interface Definition
C interface:
float atanhf(float x);
double atanh(double x);
Fortran interface:
RES = ATANHF(X)
RES = ATANH(X)
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
x |
|
Floating-point value of the input data |
Input |
Return Value
- Return the hyperbolic arc tangent function value y of the radian angle x. x ∈ (-1, +1).
- If the input is +1, the return value is +∞.
- If you enter -1, -∞ is returned.
- If the input |x| is greater than 1, the return value is NaN.
- If the input is ±∞, the return value is NaN.
- If the input is NaN, the return value is NaN.
Dependencies
C: "km.h"
Fortran: "km.f03"
Examples
C interface:
double pi = acos(-1);
// typical usage
double a = pi/5, c = -3*pi/4, b = pi/8;
// special handling
double d = +0.0, h = -0.0, e = INFINITY, f = -INFINITY, g = NAN;
// print result
printf("atanh(pi/5) = %.15f\n", atanh(a));
printf("atanh(-3*pi/4) = %.15f\n", atanh(c));
printf("atanh(pi/8) = %.15f\n", atanh(b));
printf("atanh(+0.0) = %+.15f\n", atanh(d));
printf("atanh(-0.0) = %+.15f\n", atanh(h));
printf("atanh(INFINITY) = %+.15f\n", atanh(e));
printf("atanh(-INFINITY) = %+.15f\n", atanh(f));
printf("atanh(NAN) = %.15f\n", atanh(g));
/*
* atanh(pi/3) = 0.738632981507743
* atanh(-3*pi/4) = nan
* atanh(pi/2) = 0.414987256841989
* atanh(+0.0) = +0.000000000000000
* atanh(-0.0) = -0.000000000000000
* atanh(INFINITY) = +nan
* atanh(-INFINITY) = +nan
* atanh(NAN) = nan
*
* */
Fortran interface:
REAL(8) :: X = 0.0
PRINT*, ATANH(X)
!
! OUTPUT
! 0.000000000000000
!
Parent topic: Function Syntax