cosh -- Compute the Hyperbolic Cosine

SYNOPSIS

 #include <math.h>

 double cosh(double x);
 

DESCRIPTION

cosh computes the hyperbolic cosine of its argument x, as expressed by the following relation:
 r = (e**x + e**-x)/2
 

RETURN VALUE

cosh returns the value of the hyperbolic cosine of the argument x, provided that this value is defined and computable. The return value is a double-precision, floating-point number.

DIAGNOSTICS

For x with an absolute value too large to be represented, the function returns HUGE_VAL. The run-time library writes an error message to stderr (the standard error file).

If an error occurs in cosh, the _matherr routine is called. You can supply your own version of _matherr to suppress the diagnostic message or modify the value returned.

EXAMPLE

This example computes the hyperbolic secant of a number using cosh:
  #include <math.h>
  #include <stdio.h>

  #define VALUE 3.76182

  main()
  {
     double secant_h;

        /* The hyperbolic secant of VALUE is 1 divided  */
        /* by the hyperbolic cosine of VALUE.           */
     secant_h = 1 / cosh(VALUE);

     printf("1 / cosh(%f) = %fn", VALUE, secant_h);
  }

 

RELATED FUNCTIONS

sinh, tanh, _matherr

SEE ALSO

Mathematical Functions

Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.