/* atanhl.c
*
* Inverse hyperbolic tangent , long double precision
*
*
*
* SYNOPSIS :
*
* long double x , y , atanhl ( ) ;
*
* y = atanhl ( x ) ;
*
*
*
* DESCRIPTION :
*
* Returns inverse hyperbolic tangent of argument in the range
* MINLOGL to MAXLOGL .
*
* If | x | < 0 . 5 , the rational form x + x * * 3 P ( x ) / Q ( x ) is
* employed . Otherwise ,
* atanh ( x ) = 0 . 5 * log ( ( 1 + x ) / ( 1 - x ) ) .
*
*
*
* ACCURACY :
*
* Relative error :
* arithmetic domain # trials peak rms
* IEEE - 1 , 1 30000 1 . 1 e - 19 3 . 3 e - 20
*
*/
/*
Cephes Math Library Release 2 . 7 : May , 1998
Copyright ( C ) 1987 , 1991 , 1998 by Stephen L . Moshier
*/
#include "mconf.h"
#ifdef UNK
static long double P[] = {
2 .9647757819596835680719 E-3 L,
-8 .0026596513099094380633 E-1 L,
7 .7920941408493040219831 E0L,
-2 .4330686602187898836837 E1L,
3 .0204265014595622991082 E1L,
-1 .2961142942114056581210 E1L,
};
static long double Q[] = {
/* 1.0000000000000000000000E0L,*/
-1 .3729634163247557081869 E1L,
6 .2320841104088512332185 E1L,
-1 .2469344457045341444078 E2L,
1 .1394285233959210574352 E2L,
-3 .8883428826342169425890 E1L,
};
#endif
#ifdef IBMPC
static short P[] = {
0 x3aa2,0 x036b,0 xaf06,0 xc24c,0 x3ff6, XPD
0 x528e,0 x56e8,0 x3af4,0 xccde,0 xbffe, XPD
0 x9d89,0 xc9a1,0 xd5cf,0 xf958,0 x4001, XPD
0 xa653,0 x6cfa,0 x3f04,0 xc2a5,0 xc003, XPD
0 xc651,0 x2b3d,0 x55b2,0 xf1a2,0 x4003, XPD
0 xd76d,0 xf293,0 xd76b,0 xcf60,0 xc002, XPD
};
static short Q[] = {
/*0x0000,0x0000,0x0000,0x8000,0x3fff,*/
0 xd1b9,0 x5314,0 x94df,0 xdbac,0 xc002, XPD
0 x3caa,0 x0517,0 x8a92,0 xf948,0 x4004, XPD
0 x535e,0 xaf5f,0 x0b2a,0 xf963,0 xc005, XPD
0 xa6f9,0 xb702,0 xbd8a,0 xe3e2,0 x4005, XPD
0 xe136,0 xf5ee,0 xa190,0 x9b88,0 xc004, XPD
};
#endif
#ifdef MIEEE
static long P[] = {
0 x3ff60000,0 xc24caf06,0 x036b3aa2,
0 xbffe0000,0 xccde3af4,0 x56e8528e,
0 x40010000,0 xf958d5cf,0 xc9a19d89,
0 xc0030000,0 xc2a53f04,0 x6cfaa653,
0 x40030000,0 xf1a255b2,0 x2b3dc651,
0 xc0020000,0 xcf60d76b,0 xf293d76d,
};
static long Q[] = {
/*0x3fff0000,0x80000000,0x00000000,*/
0 xc0020000,0 xdbac94df,0 x5314d1b9,
0 x40040000,0 xf9488a92,0 x05173caa,
0 xc0050000,0 xf9630b2a,0 xaf5f535e,
0 x40050000,0 xe3e2bd8a,0 xb702a6f9,
0 xc0040000,0 x9b88a190,0 xf5eee136,
};
#endif
extern long double MAXNUML;
#ifdef ANSIPROT
extern long double fabsl ( long double );
extern long double logl ( long double );
extern long double polevll ( long double , void *, int );
extern long double p1evll ( long double , void *, int );
#else
long double fabsl(), logl(), polevll(), p1evll();
#endif
#ifdef INFINITIES
extern long double INFINITYL;
#endif
#ifdef NANS
extern long double NANL;
#endif
long double atanhl(x)
long double x;
{
long double s, z;
#ifdef MINUSZERO
if ( x == 0 .0 L )
return (x);
#endif
z = fabsl(x);
if ( z >= 1 .0 L )
{
if ( x == 1 .0 L )
{
#ifdef INFINITIES
return ( INFINITYL );
#else
return ( MAXNUML );
#endif
}
if ( x == -1 .0 L )
{
#ifdef INFINITIES
return ( -INFINITYL );
#else
return ( -MAXNUML );
#endif
}
mtherr( "atanhl" , DOMAIN );
#ifdef NANS
return ( NANL );
#else
return ( MAXNUML );
#endif
}
if ( z < 1 .0 e-8 L )
return (x);
if ( z < 0 .5 L )
{
z = x * x;
s = x + x * z * (polevll(z, P, 5 ) / p1evll(z, Q, 5 ));
return (s);
}
return ( 0 .5 L * logl((1 .0 L+x)/(1 .0 L-x)) );
}
Messung V0.5 in Prozent C=97 H=100 G=98
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-14)
¤
*© Formatika GbR, Deutschland