hyperbolic cosine function

You're viewing an older version of this page (#3429). View the current version.

View versions (5)

INTERFACE

#include <math.h>

double cosh ( double x ) long coshl ( long double x ) float coshf ( float x )

DESCRIPTION

The cosh function computes the hyperbolic cosine of x, which is defined through:

\mathrm{cosh}(x) := \frac{e^x + e^{-x}}{2}
(1)

Example 1

#include <stdio.h>
#include <math.h>

int main(void)
{
  double x = 0.5;
  double result = cosh(x);
  printf("The hyperbolic cosine of %lf is %lf\n", x, result);
  return 0;
}

Output:

The hyperbolic cosine of 0.500000 is 1.127626

SPECIAL VALUES

cosh ( &plusmn;0 ) returns 1.
cosh ( &plusmn;&infin; ) returns +&infin;.

SEE ALSO

acos, asin, atan, atan2, cos, sin, sinh, tan, tanh

STANDARDS

The cosh function conforms to ISO/IEC 9899:1999(E).