/* sinhl.c
*
* Hyperbolic sine , long double precision
*
*
*
* SYNOPSIS :
*
* long double x , y , sinhl ( ) ;
*
* y = sinhl ( x ) ;
*
*
*
* DESCRIPTION :
*
* Returns hyperbolic sine of argument in the range MINLOGL to
* MAXLOGL .
*
* The range is partitioned into two segments . If | x | < = 1 , a
* rational function of the form x + x * * 3 P ( x ) / Q ( x ) is employed .
* Otherwise the calculation is sinh ( x ) = ( exp ( x ) - exp ( - x ) ) / 2 .
*
*
*
* ACCURACY :
*
* Relative error :
* arithmetic domain # trials peak rms
* IEEE - 2 , 2 10000 1 . 5 e - 19 3 . 9 e - 20
* IEEE + - 10000 30000 1 . 1 e - 19 2 . 8 e - 20
*
*/
/*
Cephes Math Library Release 2 . 7 : January , 1998
Copyright 1984 , 1991 , 1998 by Stephen L . Moshier
*/
#include "mconf.h"
#ifdef UNK
static long double P[] = {
1 .7550769032975377032681 E-6 L,
4 .1680702175874268714539 E-4 L,
3 .0993532520425419002409 E-2 L,
9 .9999999999999999998002 E-1 L,
};
static long double Q[] = {
1 .7453965448620151484660 E-8 L,
-5 .9116673682651952419571 E-6 L,
1 .0599252315677389339530 E-3 L,
-1 .1403880487744749056675 E-1 L,
6 .0000000000000000000200 E0L,
};
#endif
#ifdef IBMPC
static short P[] = {
0 xec6a,0 xd942,0 xfbb3,0 xeb8f,0 x3feb, XPD
0 x365e,0 xb30a,0 xe437,0 xda86,0 x3ff3, XPD
0 x8890,0 x01f6,0 x2612,0 xfde6,0 x3ff9, XPD
0 x0000,0 x0000,0 x0000,0 x8000,0 x3fff, XPD
};
static short Q[] = {
0 x4edd,0 x4c21,0 xad09,0 x95ed,0 x3fe5, XPD
0 x4376,0 x9b70,0 xd605,0 xc65c,0 xbfed, XPD
0 xc8ad,0 x5d21,0 x3069,0 x8aed,0 x3ff5, XPD
0 x9c32,0 x6374,0 x2d4b,0 xe98d,0 xbffb, XPD
0 x0000,0 x0000,0 x0000,0 xc000,0 x4001, XPD
};
#endif
#ifdef MIEEE
static long P[] = {
0 x3feb0000,0 xeb8ffbb3,0 xd942ec6a,
0 x3ff30000,0 xda86e437,0 xb30a365e,
0 x3ff90000,0 xfde62612,0 x01f68890,
0 x3fff0000,0 x80000000,0 x00000000,
};
static long Q[] = {
0 x3fe50000,0 x95edad09,0 x4c214edd,
0 xbfed0000,0 xc65cd605,0 x9b704376,
0 x3ff50000,0 x8aed3069,0 x5d21c8ad,
0 xbffb0000,0 xe98d2d4b,0 x63749c32,
0 x40010000,0 xc0000000,0 x00000000,
};
#endif
extern long double MAXNUML, MAXLOGL, MINLOGL, LOGE2L;
#ifdef ANSIPROT
extern long double fabsl ( long double );
extern long double expl ( long double );
extern long double polevll ( long double , void *, int );
extern long double p1evll ( long double , void *, int );
#else
long double fabsl(), expl(), polevll(), p1evll();
#endif
#ifdef INFINITIES
extern long double INFINITYL;
#endif
#ifdef NANS
extern long double NANL;
#endif
long double sinhl(x)
long double x;
{
long double a;
#ifdef MINUSZERO
if ( x == 0 .0 )
return (x);
#endif
a = fabsl(x);
if ( (x > (MAXLOGL + LOGE2L)) || (x > -(MINLOGL-LOGE2L) ) )
{
mtherr( "sinhl" , DOMAIN );
#ifdef INFINITIES
if ( x > 0 .0 L )
return ( INFINITYL );
else
return ( -INFINITYL );
#else
if ( x > 0 .0 L )
return ( MAXNUML );
else
return ( -MAXNUML );
#endif
}
if ( a > 1 .0 L )
{
if ( a >= (MAXLOGL - LOGE2L) )
{
a = expl(0 .5 L*a);
a = (0 .5 L * a) * a;
if ( x < 0 .0 L )
a = -a;
return (a);
}
a = expl(a);
a = 0 .5 L*a - (0 .5 L/a);
if ( x < 0 .0 L )
a = -a;
return (a);
}
a *= a;
return ( x + x * a * (polevll(a,P,3 )/polevll(a,Q,4 )) );
}
Messung V0.5 in Prozent C=99 H=100 G=99
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-13)
¤
*© Formatika GbR, Deutschland