/* atanhl.c
*
* Inverse hyperbolic tangent , 128 - bit 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 100 , 000 2 . 0 e - 34 4 . 6 e - 35
*
*/
/*
Cephes Math Library Release 2 . 2 : January , 1991
Copyright ( C ) 1987 , 1991 by Stephen L . Moshier
Direct inquiries to 30 Frost Street , Cambridge , MA 02140
*/
#include "mconf.h"
/* atanh(x) = x + x^3 R(x^2)
* Theoretical peak relative error = 7 . 0 e - 37
* relative peak error spread = 2 . 7 e - 6
*/
static long double P[10 ] = {
-9 .217569843805850417698565442251656375681 E-1 L,
5 .321929116410615470118183794063211260728 E1L,
-9 .139522976807685333981548145417830690552 E2L,
7 .204314536952949779101646454146682033772 E3L,
-3 .097809640165146436529075324081668598891 E4L,
7 .865376554210973897486215630898496100534 E4L,
-1 .211716814094785128366087489224821937203 E5L,
1 .112669508789123834670923967462068457013 E5L,
-5 .600242872292477863751728708249167956542 E4L,
1 .188901082233997739779618679364295772810 E4L
};
static long double Q[] = {
/* 1.000000000000000000000000000000000000000E0L, */
-6 .807348436010016270202879229504392062418 E1L,
1 .386763299649315831625106608182196351693 E3L,
-1 .310805752656879543134785263832907269320 E4L,
6 .872174720355764193772953852564737816928 E4L,
-2 .181008360536226513009076189881617939380 E5L,
4 .362736119602298592874941767284979857248 E5L,
-5 .535251007539393347687001489396152923502 E5L,
4 .321594849688346708841188057241308805551 E5L,
-1 .894075056489862952285849974761239845873 E5L,
3 .566703246701993219338856038092901974725 E4L
};
extern double MAXNUML;
long double atanhl(x)
long double x;
{
long double s, z;
long double fabsl(), logl(), polevll(), p1evll();
z = fabsl(x);
if ( z >= 1 .0 L )
{
if ( x == 1 .0 L )
return ( MAXNUML );
if ( x == -1 .0 L )
return ( -MAXNUML );
mtherr( "atanhl" , DOMAIN );
return ( MAXNUML );
}
if ( z < 1 .0 e-12 L )
return (x);
if ( z < 0 .5 L )
{
z = x * x;
s = x + x * z * (polevll(z, P, 9 ) / p1evll(z, Q, 10 ));
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.11 Sekunden
(vorverarbeitet am 2026-06-15)
¤
*© Formatika GbR, Deutschland