/* acoshl.c
*
* Inverse hyperbolic cosine , 128 - bit long double precision
*
*
*
* SYNOPSIS :
*
* long double x , y , acoshl ( ) ;
*
* y = acoshl ( x ) ;
*
*
*
* DESCRIPTION :
*
* Returns inverse hyperbolic cosine of argument .
*
* If 1 < = x < 1 . 5 , a rational approximation
*
* sqrt ( 2 z ) * P ( z ) / Q ( z )
*
* where z = x - 1 , is used . Otherwise ,
*
* acosh ( x ) = log ( x + sqrt ( ( x - 1 ) ( x + 1 ) ) .
*
*
*
* ACCURACY :
*
* Relative error :
* arithmetic domain # trials peak rms
* IEEE 1 , 3 100 , 000 4 . 1 e - 34 7 . 3 e - 35
*
*
* ERROR MESSAGES :
*
* message condition value returned
* acoshl domain | x | < 1 0 . 0
*
*/
/* acosh.c */
/*
Cephes Math Library Release 2 . 2 : January , 1991
Copyright 1984 , 1991 by Stephen L . Moshier
Direct inquiries to 30 Frost Street , Cambridge , MA 02140
*/
#include "mconf.h"
/* acosh(1+x) = sqrt(2x) * R(x), interval 0 < x < 0.5
* Theoretical peak relative error = 8 . 2 e - 36
* relative peak error spread = 9 . 9 e - 8
*/
static long double P[10 ] = {
1 .895467874386341763387398084072833727168 E-1 L,
6 .443902084393244878979969557171256604767 E1L,
3 .914593556594721458616408528941154205393 E3L,
9 .164040999602964494412169748897754668733 E4L,
1 .065909694792026382660307834723001543839 E6L,
6 .899169896709615182428217047370629406305 E6L,
2 .599781868717579447900896150777162652518 E7L,
5 .663733059389964024656501196827345337766 E7L,
6 .606302846870644033621560858582696134512 E7L,
3 .190482951215438078279772140481195200593 E7L
};
static long double Q[9 ] = {
/* 1.000000000000000000000000000000000000000E0L, */
1 .635418024331924674147953764918262009321 E2L,
7 .290983678312632723073455563799692165828 E3L,
1 .418207894088607063257675159183397062114 E5L,
1 .453154285419072886840913424715826321357 E6L,
8 .566841438576725234955968880501739464425 E6L,
3 .003448667795089562511136059766833630017 E7L,
6 .176592872899557661256383958395266919654 E7L,
6 .872176426138597206811541870289420510034 E7L,
3 .190482951215438078279772140481195226621 E7L
};
extern long double LOGE2L;
long double acoshl(x)
long double x;
{
long double a, z;
long double logl(), sqrtl(), polevll(), p1evll();
if ( x < 1 .0 L )
{
mtherr( "acoshl" , DOMAIN );
return (0 .0 L);
}
if ( x > 1 .0 e17L )
return ( logl(x) + LOGE2L );
z = x - 1 .0 L;
if ( z < 0 .5 L )
{
a = sqrtl(2 .0 L*z) * (polevll(z, P, 9 ) / p1evll(z, Q, 9 ) );
return ( a );
}
a = sqrtl( z*(x+1 .0 L) );
return ( logl(x + a) );
}
Messung V0.5 in Prozent C=95 H=99 G=96
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-23)
¤
*© Formatika GbR, Deutschland