/* ellpe.c
*
* Complete elliptic integral of the second kind
*
*
*
* SYNOPSIS :
*
* double m1 , y , ellpe ( ) ;
*
* y = ellpe ( 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
* DEC 0 , 1 13000 3 . 1 e - 17 9 . 4 e - 18
* IEEE 0 , 1 10000 2 . 1 e - 16 7 . 3 e - 17
*
*
* ERROR MESSAGES :
*
* message condition value returned
* ellpe domain x < 0 , x > 1 0 . 0
*
*/
/* ellpe.c */
/* Elliptic integral of second kind */
/*
Cephes Math Library , Release 2 . 8 : June , 2000
Copyright 1984 , 1987 , 1989 , 2000 by Stephen L . Moshier
*/
#include "mconf.h"
#ifdef UNK
static double P[] = {
1 .53552577301013293365 E-4 ,
2 .50888492163602060990 E-3 ,
8 .68786816565889628429 E-3 ,
1 .07350949056076193403 E-2 ,
7 .77395492516787092951 E-3 ,
7 .58395289413514708519 E-3 ,
1 .15688436810574127319 E-2 ,
2 .18317996015557253103 E-2 ,
5 .68051945617860553470 E-2 ,
4 .43147180560990850618 E-1 ,
1 .00000000000000000299 E0
};
static double Q[] = {
3 .27954898576485872656 E-5 ,
1 .00962792679356715133 E-3 ,
6 .50609489976927491433 E-3 ,
1 .68862163993311317300 E-2 ,
2 .61769742454493659583 E-2 ,
3 .34833904888224918614 E-2 ,
4 .27180926518931511717 E-2 ,
5 .85936634471101055642 E-2 ,
9 .37499997197644278445 E-2 ,
2 .49999999999888314361 E-1
};
#endif
#ifdef DEC
static unsigned short P[] = {
0035041 ,0001364 ,0141572 ,0117555 ,
0036044 ,0066032 ,0130027 ,0033404 ,
0036416 ,0053617 ,0064456 ,0102632 ,
0036457 ,0161100 ,0061177 ,0122612 ,
0036376 ,0136251 ,0012403 ,0124162 ,
0036370 ,0101316 ,0151715 ,0131613 ,
0036475 ,0105477 ,0050317 ,0133272 ,
0036662 ,0154232 ,0024645 ,0171552 ,
0037150 ,0126220 ,0047054 ,0030064 ,
0037742 ,0162057 ,0167645 ,0165612 ,
0040200 ,0000000 ,0000000 ,0000000
};
static unsigned short Q[] = {
0034411 ,0106743 ,0115771 ,0055462 ,
0035604 ,0052575 ,0155171 ,0045540 ,
0036325 ,0030424 ,0064332 ,0167756 ,
0036612 ,0052366 ,0063006 ,0115175 ,
0036726 ,0070430 ,0004533 ,0124654 ,
0037011 ,0022741 ,0030675 ,0030711 ,
0037056 ,0174452 ,0127062 ,0132122 ,
0037157 ,0177750 ,0142041 ,0072523 ,
0037277 ,0177777 ,0173137 ,0002627 ,
0037577 ,0177777 ,0177777 ,0101101
};
#endif
#ifdef IBMPC
static unsigned short P[] = {
0 x53ee,0 x986f,0 x205e,0 x3f24,
0 xe6e0,0 x5602,0 x8d83,0 x3f64,
0 xd0b3,0 xed25,0 xcaf1,0 x3f81,
0 xf4b1,0 x0c4f,0 xfc48,0 x3f85,
0 x750e,0 x22a0,0 xd795,0 x3f7f,
0 xb671,0 xda79,0 x1059,0 x3f7f,
0 xf6d7,0 xea19,0 xb167,0 x3f87,
0 xbe6d,0 x4534,0 x5b13,0 x3f96,
0 x8607,0 x09c5,0 x1592,0 x3fad,
0 xbd71,0 xfdf4,0 x5c85,0 x3fdc,
0 x0000,0 x0000,0 x0000,0 x3ff0
};
static unsigned short Q[] = {
0 x2b66,0 x737f,0 x31bc,0 x3f01,
0 x296c,0 xbb4f,0 x8aaf,0 x3f50,
0 x5dfe,0 x8d1b,0 xa622,0 x3f7a,
0 xd350,0 xccc0,0 x4a9e,0 x3f91,
0 x7535,0 x012b,0 xce23,0 x3f9a,
0 xa639,0 x2637,0 x24bc,0 x3fa1,
0 x568a,0 x55c6,0 xdf25,0 x3fa5,
0 x2eaa,0 x1884,0 xfffd,0 x3fad,
0 xe0b3,0 xfecb,0 xffff,0 x3fb7,
0 xf048,0 xffff,0 xffff,0 x3fcf
};
#endif
#ifdef MIEEE
static unsigned short P[] = {
0 x3f24,0 x205e,0 x986f,0 x53ee,
0 x3f64,0 x8d83,0 x5602,0 xe6e0,
0 x3f81,0 xcaf1,0 xed25,0 xd0b3,
0 x3f85,0 xfc48,0 x0c4f,0 xf4b1,
0 x3f7f,0 xd795,0 x22a0,0 x750e,
0 x3f7f,0 x1059,0 xda79,0 xb671,
0 x3f87,0 xb167,0 xea19,0 xf6d7,
0 x3f96,0 x5b13,0 x4534,0 xbe6d,
0 x3fad,0 x1592,0 x09c5,0 x8607,
0 x3fdc,0 x5c85,0 xfdf4,0 xbd71,
0 x3ff0,0 x0000,0 x0000,0 x0000
};
static unsigned short Q[] = {
0 x3f01,0 x31bc,0 x737f,0 x2b66,
0 x3f50,0 x8aaf,0 xbb4f,0 x296c,
0 x3f7a,0 xa622,0 x8d1b,0 x5dfe,
0 x3f91,0 x4a9e,0 xccc0,0 xd350,
0 x3f9a,0 xce23,0 x012b,0 x7535,
0 x3fa1,0 x24bc,0 x2637,0 xa639,
0 x3fa5,0 xdf25,0 x55c6,0 x568a,
0 x3fad,0 xfffd,0 x1884,0 x2eaa,
0 x3fb7,0 xffff,0 xfecb,0 xe0b3,
0 x3fcf,0 xffff,0 xffff,0 xf048
};
#endif
#ifdef ANSIPROT
extern double polevl ( double , void *, int );
extern double log ( double );
#else
double polevl(), log();
#endif
double ellpe(x)
double x;
{
if ( (x <= 0 .0 ) || (x > 1 .0 ) )
{
if ( x == 0 .0 )
return ( 1 .0 );
mtherr( "ellpe" , DOMAIN );
return ( 0 .0 );
}
return ( polevl(x,P,10 ) - log(x) * (x * polevl(x,Q,9 )) );
}
Messung V0.5 in Prozent C=98 H=100 G=98
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-16)
¤
*© Formatika GbR, Deutschland