/* asinhl.c
*
* Inverse hyperbolic sine , long double precision
*
*
*
* SYNOPSIS :
*
* long double x , y , asinhl ( ) ;
*
* y = asinhl ( x ) ;
*
*
*
* DESCRIPTION :
*
* Returns inverse hyperbolic sine of argument .
*
* If | x | < 0 . 5 , the function is approximated by a rational
* form x + x * * 3 P ( x ) / Q ( x ) . Otherwise ,
*
* asinh ( x ) = log ( x + sqrt ( 1 + x * x ) ) .
*
*
*
* ACCURACY :
*
* Relative error :
* arithmetic domain # trials peak rms
* IEEE - 3 , 3 30000 1 . 7 e - 19 3 . 5 e - 20
*
*/
/*
Cephes Math Library Release 2 . 7 : May , 1998
Copyright 1984 , 1991 , 1998 by Stephen L . Moshier
*/
#include "mconf.h"
#ifdef UNK
static long double P[] = {
-7 .2157234864927687427374 E-1 L,
-1 .3005588097490352458918 E1L,
-5 .9112383795679709212744 E1L,
-9 .5372702442289028811361 E1L,
-4 .9802880260861844539014 E1L,
};
static long double Q[] = {
/* 1.0000000000000000000000E0L,*/
2 .8754968540389640419671 E1L,
2 .0990255691901160529390 E2L,
5 .9265075560893800052658 E2L,
7 .0670399135805956780660 E2L,
2 .9881728156517107462943 E2L,
};
#endif
#ifdef IBMPC
static short P[] = {
0 x8f42,0 x2584,0 xf727,0 xb8b8,0 xbffe, XPD
0 x9d56,0 x7f7c,0 xe38b,0 xd016,0 xc002, XPD
0 xc518,0 xdc2d,0 x14bc,0 xec73,0 xc004, XPD
0 x99fe,0 xc18a,0 xd2da,0 xbebe,0 xc005, XPD
0 xb46c,0 x3c05,0 x263e,0 xc736,0 xc004, XPD
};
static short Q[] = {
/*0x0000,0x0000,0x0000,0x8000,0x3fff,*/
0 xdfed,0 x33db,0 x2cf2,0 xe60a,0 x4003, XPD
0 xf109,0 x61ee,0 x0df8,0 xd1e7,0 x4006, XPD
0 xf21e,0 xda84,0 xa5fa,0 x9429,0 x4008, XPD
0 x13fc,0 xc4e2,0 x0e31,0 xb0ad,0 x4008, XPD
0 x485c,0 xad04,0 x9cae,0 x9568,0 x4007, XPD
};
#endif
#ifdef MIEEE
static long P[] = {
0 xbffe0000,0 xb8b8f727,0 x25848f42,
0 xc0020000,0 xd016e38b,0 x7f7c9d56,
0 xc0040000,0 xec7314bc,0 xdc2dc518,
0 xc0050000,0 xbebed2da,0 xc18a99fe,
0 xc0040000,0 xc736263e,0 x3c05b46c,
};
static long Q[] = {
/*0x3fff0000,0x80000000,0x00000000,*/
0 x40030000,0 xe60a2cf2,0 x33dbdfed,
0 x40060000,0 xd1e70df8,0 x61eef109,
0 x40080000,0 x9429a5fa,0 xda84f21e,
0 x40080000,0 xb0ad0e31,0 xc4e213fc,
0 x40070000,0 x95689cae,0 xad04485c,
};
#endif
extern long double LOGE2L;
#ifdef INFINITIES
extern long double INFINITYL;
#endif
#ifdef ANSIPROT
extern long double logl ( long double );
extern long double sqrtl ( long double );
extern long double polevll ( long double , void *, int );
extern long double p1evll ( long double , void *, int );
extern int isnanl ( long double );
extern int isfinitel ( long double );
#else
long double logl(), sqrtl(), polevll(), p1evll(), isnanl(), isfinitel();
#endif
long double asinhl(x)
long double x;
{
long double a, z;
int sign;
#ifdef NANS
if ( isnanl(x) )
return (x);
#endif
#ifdef MINUSZERO
if ( x == 0 .0 L )
return (x);
#endif
#ifdef INFINITIES
if ( !isfinitel(x) )
return (x);
#endif
if ( x < 0 .0 L )
{
sign = -1 ;
x = -x;
}
else
sign = 1 ;
if ( x > 1 .0 e10L )
{
return ( sign * (logl(x) + LOGE2L) );
}
z = x * x;
if ( x < 0 .5 L )
{
a = ( polevll(z, P, 4 )/p1evll(z, Q, 5 ) ) * z;
a = a * x + x;
if ( sign < 0 )
a = -a;
return (a);
}
a = sqrtl( z + 1 .0 L );
return ( sign * logl(x + a) );
}
Messung V0.5 in Prozent C=97 H=100 G=98
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-06-15)
¤
*© Formatika GbR, Deutschland