Rate This Document
Findability
Accuracy
Completeness
Readability

acosh

Compute the hyperbolic arc cosine value of a real number.

Interface Definition

C interface:

float acoshf(float x);

double acosh(double x);

Fortran interface:

RES = ACOSHF(X);

RES = ACOSH(X);

Parameters

Parameter

Type

Description

Input/Output

x

  • For acoshf, x is of single-precision floating-point type.
  • For acosh, x is of double-precision floating-point type.

Floating-point value of a radian angle

Input

Return Value

  • Return the hyperbolic arc cosine function value y of the radian angle x. x ∈ [1, +∞).
  • If the input is +1, the return value is +0.
  • If the input x is less than +1, NaN is returned.
  • If the input is +∞, the return value is +∞.
  • 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/3, b = pi/2, c = -3*pi/4, d = 0.0; 
    // special handling 
    double e = INFINITY, f = -INFINITY, g = NAN; 
    // print result 
    printf("acosh(pi/3) = %.15f\n", acosh(a)); 
    printf("acosh(pi/2) = %.15f\n", acosh(b)); 
    printf("acosh(-3*pi/4) = %.15f\n", acosh(c)); 
    printf("acosh(0.0) = %.15f\n", acosh(d)); 
    printf("acosh(INFINITY) = %.15f\n", acosh(e)); 
    printf("acosh(-INFINITY) = %.15f\n", acosh(f)); 
    printf("acosh(NAN) = %.15f\n", acosh(g)); 
    /* 
     *  acosh(pi/3) = 0.306042108613265 
     *  acosh(pi/2) = 1.023227478547551 
     *  acosh(-3*pi/4) = nan 
     *  acosh(0.0) = nan
     *  acosh(INFINITY) = inf
     *  acosh(-INFINITY) = nan 
     *  acosh(NAN) = nan 
     * 
     * */

Fortran interface:

    REAL(8) :: X = 1.0 
    PRINT*,  ACOSH(X) 
    ! 
    ! OUTPUT 
    !     0.000000000000000 
    !