/* asinh.c
*
* Inverse hyperbolic sine
*
*
*
* SYNOPSIS :
*
* double x , y , asinh ( ) ;
*
* y = asinh ( 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
* DEC - 3 , 3 75000 4 . 6 e - 17 1 . 1 e - 17
* IEEE - 1 , 1 30000 3 . 7 e - 16 7 . 8 e - 17
* IEEE 1 , 3 30000 2 . 5 e - 16 6 . 7 e - 17
*
*/
/* asinh.c */
/*
Cephes Math Library Release 2 . 8 : June , 2000
Copyright 1984 , 1995 , 2000 by Stephen L . Moshier
*/
#include "mconf.h"
#ifdef UNK
static double P[] = {
-4 .33231683752342103572 E-3 ,
-5 .91750212056387121207 E-1 ,
-4 .37390226194356683570 E0,
-9 .09030533308377316566 E0,
-5 .56682227230859640450 E0
};
static double Q[] = {
/* 1.00000000000000000000E0,*/
1 .28757002067426453537 E1,
4 .86042483805291788324 E1,
6 .95722521337257608734 E1,
3 .34009336338516356383 E1
};
#endif
#ifdef DEC
static unsigned short P[] = {
0136215 ,0173033 ,0110410 ,0105475 ,
0140027 ,0076361 ,0020056 ,0164520 ,
0140613 ,0173401 ,0160136 ,0053142 ,
0141021 ,0070744 ,0000503 ,0176261 ,
0140662 ,0021550 ,0073106 ,0133351
};
static unsigned short Q[] = {
/* 0040200,0000000,0000000,0000000,*/
0041116 ,0001336 ,0034120 ,0173054 ,
0041502 ,0065300 ,0013144 ,0021231 ,
0041613 ,0022376 ,0035516 ,0153063 ,
0041405 ,0115216 ,0054265 ,0004557
};
#endif
#ifdef IBMPC
static unsigned short P[] = {
0 x1168,0 x7221,0 xbec3,0 xbf71,
0 xdd2a,0 x2405,0 xef9e,0 xbfe2,
0 xcacc,0 x3c0b,0 x7ee0,0 xc011,
0 x7f96,0 x8028,0 x2e3c,0 xc022,
0 xd6dd,0 x0ec8,0 x446d,0 xc016
};
static unsigned short Q[] = {
/* 0x0000,0x0000,0x0000,0x3ff0,*/
0 x1ec5,0 xc70a,0 xc05b,0 x4029,
0 x8453,0 x02cc,0 x4d58,0 x4048,
0 xdac6,0 xc769,0 x649f,0 x4051,
0 xa12e,0 xcb16,0 xb351,0 x4040
};
#endif
#ifdef MIEEE
static unsigned short P[] = {
0 xbf71,0 xbec3,0 x7221,0 x1168,
0 xbfe2,0 xef9e,0 x2405,0 xdd2a,
0 xc011,0 x7ee0,0 x3c0b,0 xcacc,
0 xc022,0 x2e3c,0 x8028,0 x7f96,
0 xc016,0 x446d,0 x0ec8,0 xd6dd
};
static unsigned short Q[] = {
0 x4029,0 xc05b,0 xc70a,0 x1ec5,
0 x4048,0 x4d58,0 x02cc,0 x8453,
0 x4051,0 x649f,0 xc769,0 xdac6,
0 x4040,0 xb351,0 xcb16,0 xa12e
};
#endif
#ifdef ANSIPROT
extern double polevl ( double , void *, int );
extern double p1evl ( double , void *, int );
extern double sqrt ( double );
extern double log ( double );
#else
double log(), sqrt(), polevl(), p1evl();
#endif
extern double LOGE2, INFINITY;
double asinh(xx)
double xx;
{
double a, z, x;
int sign;
#ifdef MINUSZERO
if ( xx == 0 .0 )
return (xx);
#endif
if ( xx < 0 .0 )
{
sign = -1 ;
x = -xx;
}
else
{
sign = 1 ;
x = xx;
}
if ( x > 1 .0 e8 )
{
#ifdef INFINITIES
if ( x == INFINITY )
return (xx);
#endif
return ( sign * (log(x) + LOGE2) );
}
z = x * x;
if ( x < 0 .5 )
{
a = ( polevl(z, P, 4 )/p1evl(z, Q, 4 ) ) * z;
a = a * x + x;
if ( sign < 0 )
a = -a;
return (a);
}
a = sqrt( z + 1 .0 );
return ( sign * log(x + a) );
}
Messung V0.5 in Prozent C=97 H=100 G=98
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-27)
¤
*© Formatika GbR, Deutschland