3 * Complete elliptic integral of the first kind
9 * float m1, y, ellpkf();
17 * Approximates the integral
25 * K(m) = | ------------------
27 * | | sqrt( 1 - m sin t )
31 * where m = 1 - m1, using the approximation
35 * The argument m1 is used rather than m so that the logarithmic
36 * singularity at m = 1 will be shifted to the origin; this
37 * preserves maximum accuracy.
44 * arithmetic domain # trials peak rms
45 * IEEE 0,1 30000 1.3e-7 3.4e-8
49 * message condition value returned
50 * ellpkf domain x<0, x>1 0.0
58 Cephes Math Library, Release 2.0: April, 1987
59 Copyright 1984, 1987 by Stephen L. Moshier
60 Direct inquiries to 30 Frost Street, Cambridge, MA 02140
67 1.37982864606273237150E-4,
68 2.28025724005875567385E-3,
69 7.97404013220415179367E-3,
70 9.85821379021226008714E-3,
71 6.87489687449949877925E-3,
72 6.18901033637687613229E-3,
73 8.79078273952743772254E-3,
74 1.49380448916805252718E-2,
75 3.08851465246711995998E-2,
76 9.65735902811690126535E-2,
77 1.38629436111989062502E0
82 2.94078955048598507511E-5,
83 9.14184723865917226571E-4,
84 5.94058303753167793257E-3,
85 1.54850516649762399335E-2,
86 2.39089602715924892727E-2,
87 3.01204715227604046988E-2,
88 3.73774314173823228969E-2,
89 4.88280347570998239232E-2,
90 7.03124996963957469739E-2,
91 1.24999999999870820058E-1,
92 4.99999999999999999821E-1
94 static float C1 = 1.3862943611198906188E0; /* log(4) */
96 extern float MACHEPF, MAXNUMF;
99 float polevlf(float, float *, int);
100 float p1evlf(float, float *, int);
102 float ellpkf(float xx)
104 float polevlf(), p1evlf(), logf();
112 if( (x < 0.0) || (x > 1.0) )
114 mtherr( "ellpkf", DOMAIN );
120 return( polevlf(x,P,10) - logf(x) * polevlf(x,Q,10) );
126 mtherr( "ellpkf", SING );
131 return( C1 - 0.5 * logf(x) );