function
<cmath> <ctgmath>

acosh

     double acosh  (double x);
      float acoshf (float x);
long double acoshl (long double x);
     double acosh (double x);
      float acosh (float x);
long double acosh (long double x);
     double acosh (T x);           // additional overloads for integral types
Compute area hyperbolic cosine
Returns the nonnegative area hyperbolic cosine of x.

The area hyperbolic cosine is the inverse operation of the hyperbolic cosine.

Header <tgmath.h> provides a type-generic macro version of this function.
Additional overloads are provided in this header (<cmath>) for the integral types: These overloads effectively cast x to a double before calculations (defined for T being any integral type).

This function is also overloaded in <complex> (see complex acosh).

Parameters

x
Value whose area hyperbolic cosine is computed.
If the argument is less than 1, a domain error occurs.

Return Value

Nonnegative area hyperbolic cosine of x, in the interval [0,+INFINITY].
Note that the negative of this value is also a valid area hyperbolic cosine of x
If a domain error occurs:
- And math_errhandling has MATH_ERRNO set: the global variable errno is set to EDOM.
- And math_errhandling has MATH_ERREXCEPT set: FE_INVALID is raised.

Example

1
2
3
4
5
6
7
8
9
10
11
12
/* acosh example */
#include <stdio.h>      /* printf */
#include <math.h>       /* acosh, exp, sinh */

int main ()
{
  double param, result;
  param = exp(2) - sinh(2);
  result = acosh(param) ;
  printf ("The area hyperbolic cosine of %f is %f radians.\n", param, result);
  return 0;
}


Output:

The area hyperbolic cosine of 3.762196 is 2.000000 radians.

See also