Logo Search packages:      
Sourcecode: abakus version File versions  Download package

HNumber HMath::cosh ( const HNumber x ) [static]

Returns the hyperbolic cosine of x. Note that x must be in radians.

Definition at line 1232 of file hmath.cpp.

References exp(), HNumber::isNan(), HNumber::nan(), and negate().

Referenced by tanh().

{
  if( x.isNan() )
    return HNumber::nan();
 
  // cosh(x) = 0.5*(e^x - e^(-x) )    
  HNumber result = HMath::exp(x) + HMath::exp( HMath::negate(x) );
  result = result / 2;

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index