Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Cephes/ldouble/   (Cephes Mathematical Library ©)  Datei vom 12.5.2026 mit Größe 1 kB image not shown  

Quelle  coshl.c

  Sprache: C
 

/* 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+LOGE2L      INFINITYL
 *
 *
 */



/*
Cephes Math Library Release 2.7:  May, 1998
Copyright 1985, 1991, 1998 by Stephen L. Moshier
*/


#include "mconf.h"
extern long double MAXLOGL, MAXNUML, LOGE2L;
#ifdef ANSIPROT
extern long double expl ( long double );
extern int isnanl ( long double );
#else
long double expl(), isnanl();
#endif
#ifdef INFINITIES
extern long double INFINITYL;
#endif
#ifdef NANS
extern long double NANL;
#endif

long double coshl(x)
long double x;
{
long double y;

#ifdef NANS
if( isnanl(x) )
 return(x);
#endif
if( x < 0 )
 x = -x;
if( x > (MAXLOGL + LOGE2L) )
 {
 mtherr( "coshl", OVERFLOW );
#ifdef INFINITIES
 return( INFINITYL );
#else
 return( MAXNUML );
#endif
 } 
if( x >= (MAXLOGL - LOGE2L) )
 {
 y = expl(0.5L * x);
 y = (0.5L * y) * y;
 return(y);
 }
y = expl(x);
y = 0.5L * (y + 1.0L / y);
return( y );
}

Messung V0.5 in Prozent
C=98 H=100 G=98

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-13) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.