Category : C Source Code
Archive   : CEPHES22.ZIP
Filename : COSHL.C

 
Output of file : COSHL.C contained in archive : CEPHES22.ZIP
/* coshl.c
*
* Hyperbolic cosine, long double precision
*
*
*
* SYNOPSIS:
*
* long double x, y, coshl();
*
* y = coshl( x );
*
*
*
* DESCRIPTION:
*
* Returns hyperbolic cosine of argument in the range MINLOGL to
* MAXLOGL.
*
* cosh(x) = ( exp(x) + exp(-x) )/2.
*
*
*
* ACCURACY:
*
* Relative error:
* arithmetic domain # trials peak rms
* IEEE +-10000 30000 1.1e-19 2.8e-20
*
*
* ERROR MESSAGES:
*
* message condition value returned
* cosh overflow |x| > MAXLOGL MAXNUML
*
*
*/


/*
Cephes Math Library Release 2.2: January, 1991
Copyright 1985, 1991 by Stephen L. Moshier
Direct inquiries to 30 Frost Street, Cambridge, MA 02140
*/

#include "mconf.h"
extern long double MAXLOGL, MAXNUML;

long double coshl(x)
long double x;
{
long double y;
long double expl(), ldexpl();

if( x < 0 )
x = -x;
if( x > MAXLOGL )
{
mtherr( "coshl", OVERFLOW );
return( MAXNUML );
}
y = expl(x);
y = y + 1.0L/y;
y = ldexpl( y, -1 );
return( y );
}


  3 Responses to “Category : C Source Code
Archive   : CEPHES22.ZIP
Filename : COSHL.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/