Rate This Document
Findability
Accuracy
Completeness
Readability

atanh

Compute the hyperbolic arctangent of an input real number.

Interface Definition

C interface:

float atanhf(float x);

double atanh(double x);

long double atanhl(long double x);

Fortran interface:

RES = ATANHF(X)

RES = ATANH(X)

Parameters

Parameter

Type

Description

Input/Output

x

  • For atanhf, x is of single-precision floating-point type.
  • For atanh, x is of double-precision floating-point type.
  • For atanhl, x is of long double-precision floating-point type.

Floating-point value of the input data.

Input

Return Value

  • The hyperbolic arctangent y of radian angle x is returned. x ∈ (-1, +1)
  • If the input is +1, the return value is +∞.
  • If the input is -1, the return value is -∞.
  • 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.

Dependency

C: "km.h"

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 
    !