acosh
Compute the hyperbolic arccosine of an input 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 |
|
Floating-point value of the input data. |
Input |
Return Value
- The hyperbolic arccosine y of radian angle x is returned. x ∈ [1, +∞)
- If the input is +1, the return value is +0.
- If the input x is smaller than +1, the return value is NaN.
- 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.
Dependency
C: "km.h"
Examples
C interface:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 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
!
Parent topic: Hyperbolic Functions