/* ellpel.c
*
* Complete elliptic integral of the second kind
*
*
*
* SYNOPSIS :
*
* long double m1 , y , ellpel ( ) ;
*
* y = ellpel ( m1 ) ;
*
*
*
* DESCRIPTION :
*
* Approximates the integral
*
*
* pi / 2
* -
* | | 2
* E ( m ) = | sqrt ( 1 - m sin t ) dt
* | |
* -
* 0
*
* Where m = 1 - m1 , using the approximation
*
* P ( x ) - x log x Q ( x ) .
*
* Though there are no singularities , the argument m1 is used
* rather than m for compatibility with ellpk ( ) .
*
* E ( 1 ) = 1 ; E ( 0 ) = pi / 2 .
*
*
* ACCURACY :
*
* Relative error :
* arithmetic domain # trials peak rms
* IEEE 0 , 1 10000 1 . 1 e - 19 3 . 5 e - 20
*
*
* ERROR MESSAGES :
*
* message condition value returned
* ellpel domain x < 0 , x > 1 0 . 0
*
*/
/* ellpe.c */
/* Elliptic integral of second kind */
/*
Cephes Math Library , Release 2 . 3 : October , 1995
Copyright 1984 , 1987 , 1989 , 1995 by Stephen L . Moshier
*/
#include "mconf.h"
#if UNK
static long double P[12 ] = {
3 .198937812032341294902 E-5 L,
7 .742523238588775116241 E-4 L,
4 .140384701571542000550 E-3 L,
7 .963509564694454269086 E-3 L,
7 .280911706839967541799 E-3 L,
5 .044067167184043853799 E-3 L,
5 .076832243257395296304 E-3 L,
7 .155775630578315248130 E-3 L,
1 .154485760526450950611 E-2 L,
2 .183137319801117971860 E-2 L,
5 .680519271556930583433 E-2 L,
4 .431471805599467050354 E-1 L,
};
static long double Q[12 ] = {
6 .393938134301205485085 E-6 L,
2 .741404591220851603273 E-4 L,
2 .480876752984331133799 E-3 L,
8 .770638497964078750003 E-3 L,
1 .676835725889463343319 E-2 L,
2 .281970801531577700830 E-2 L,
2 .767367465121309044166 E-2 L,
3 .364167778770018154356 E-2 L,
4 .272453406734691973083 E-2 L,
5 .859374951483909267451 E-2 L,
9 .374999999923942267270 E-2 L,
2 .499999999999998643587 E-1 L,
};
#endif
#if IBMPC
static short P[] = {
0 x7a78,0 x5a02,0 x554d,0 x862c,0 x3ff0, XPD
0 x34db,0 xa965,0 x31a3,0 xcaf7,0 x3ff4, XPD
0 xca6c,0 x6c00,0 x1071,0 x87ac,0 x3ff7, XPD
0 x4cdb,0 x125d,0 x6149,0 x8279,0 x3ff8, XPD
0 xadbd,0 x3d8f,0 xb6d5,0 xee94,0 x3ff7, XPD
0 x8189,0 xcd0e,0 xb3c2,0 xa548,0 x3ff7, XPD
0 x32b5,0 xdd64,0 x8e39,0 xa65b,0 x3ff7, XPD
0 x0344,0 xc9db,0 xff27,0 xea7a,0 x3ff7, XPD
0 xba2d,0 x806a,0 xa476,0 xbd26,0 x3ff8, XPD
0 xc3e0,0 x30fa,0 xb53d,0 xb2d7,0 x3ff9, XPD
0 x23b8,0 x4d33,0 x8fcf,0 xe8ac,0 x3ffa, XPD
0 xbc79,0 xa39f,0 x2fef,0 xe2e4,0 x3ffd, XPD
};
static short Q[] = {
0 x89f1,0 xe234,0 x82a6,0 xd68b,0 x3fed, XPD
0 x202a,0 x96b3,0 x8273,0 x8fba,0 x3ff3, XPD
0 xc183,0 xfc45,0 x3484,0 xa296,0 x3ff6, XPD
0 x683e,0 xe201,0 xb960,0 x8fb2,0 x3ff8, XPD
0 x721a,0 x1b6a,0 xcb41,0 x895d,0 x3ff9, XPD
0 x4eee,0 x295f,0 x6574,0 xbaf0,0 x3ff9, XPD
0 x3ade,0 xc98f,0 xe6f2,0 xe2b3,0 x3ff9, XPD
0 xd470,0 x1784,0 xdb1e,0 x89cb,0 x3ffa, XPD
0 xa649,0 xe5c1,0 xebc8,0 xaeff,0 x3ffa, XPD
0 x84c0,0 xa8f5,0 xffde,0 xefff,0 x3ffa, XPD
0 x5506,0 xf94f,0 xffff,0 xbfff,0 x3ffb, XPD
0 xd8e7,0 xffff,0 xffff,0 xffff,0 x3ffc, XPD
};
#endif
#if MIEEE
static long P[36 ] = {
0 x3ff00000,0 x862c554d,0 x5a027a78,
0 x3ff40000,0 xcaf731a3,0 xa96534db,
0 x3ff70000,0 x87ac1071,0 x6c00ca6c,
0 x3ff80000,0 x82796149,0 x125d4cdb,
0 x3ff70000,0 xee94b6d5,0 x3d8fadbd,
0 x3ff70000,0 xa548b3c2,0 xcd0e8189,
0 x3ff70000,0 xa65b8e39,0 xdd6432b5,
0 x3ff70000,0 xea7aff27,0 xc9db0344,
0 x3ff80000,0 xbd26a476,0 x806aba2d,
0 x3ff90000,0 xb2d7b53d,0 x30fac3e0,
0 x3ffa0000,0 xe8ac8fcf,0 x4d3323b8,
0 x3ffd0000,0 xe2e42fef,0 xa39fbc79,
};
static long Q[36 ] = {
0 x3fed0000,0 xd68b82a6,0 xe23489f1,
0 x3ff30000,0 x8fba8273,0 x96b3202a,
0 x3ff60000,0 xa2963484,0 xfc45c183,
0 x3ff80000,0 x8fb2b960,0 xe201683e,
0 x3ff90000,0 x895dcb41,0 x1b6a721a,
0 x3ff90000,0 xbaf06574,0 x295f4eee,
0 x3ff90000,0 xe2b3e6f2,0 xc98f3ade,
0 x3ffa0000,0 x89cbdb1e,0 x1784d470,
0 x3ffa0000,0 xaeffebc8,0 xe5c1a649,
0 x3ffa0000,0 xefffffde,0 xa8f584c0,
0 x3ffb0000,0 xbfffffff,0 xf94f5506,
0 x3ffc0000,0 xffffffff,0 xffffd8e7,
};
#endif
#ifdef ANSIPROT
extern long double polevll ( long double , void *, int );
extern long double logl ( long double );
#else
long double polevll(), logl();
#endif
long double ellpel(x)
long double x;
{
if ( (x <= 0 .0 L) || (x > 1 .0 L) )
{
if ( x == 0 .0 L )
return ( 1 .0 L );
mtherr( "ellpel" , DOMAIN );
return ( 0 .0 L );
}
return ( 1 .0 L + x * polevll(x,P,11 ) - logl(x) * (x * polevll(x,Q,11 )) );
}
Messung V0.5 in Prozent C=98 H=100 G=98
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-13)
¤
*© Formatika GbR, Deutschland