longdouble ellikl( phi, m ) longdouble phi, m;
{ longdouble a, b, c, e, temp, t, K; int d, mod, sign, npio2;
if( m == 0.0L ) return( phi );
a = 1.0L - m; if( a == 0.0L )
{ if( fabsl(phi) >= PIO2L )
{
mtherr( "ellikl", SING ); return( MAXNUML );
} return( logl( tanl( 0.5L*(PIO2L + phi) ) ) );
}
npio2 = floorl( phi/PIO2L ); if( npio2 & 1 )
npio2 += 1; if( npio2 )
{
K = ellpkl( a );
phi = phi - npio2 * PIO2L;
} else
K = 0.0L; if( phi < 0.0L )
{
phi = -phi;
sign = -1;
} else
sign = 0;
b = sqrtl(a);
t = tanl( phi ); if( fabsl(t) > 10.0L )
{ /* Transform the amplitude */
e = 1.0L/(b*t); /* ... but avoid multiple recursions. */ if( fabsl(e) < 10.0L )
{
e = atanl(e); if( npio2 == 0 )
K = ellpkl( a );
temp = K - ellikl( e, m ); goto done;
}
}
a = 1.0L;
c = sqrtl(m);
d = 1;
mod = 0;
while( fabsl(c/a) > MACHEPL )
{
temp = b/a;
phi = phi + atanl(t*temp) + mod * PIL;
mod = (phi + PIO2L)/PIL;
t = t * ( 1.0L + temp )/( 1.0L - temp * t * t );
c = 0.5L * ( a - b );
temp = sqrtl( a * b );
a = 0.5L * ( a + b );
b = temp;
d += d;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.