C347: Complete Elliptic Integrals of First, Second, and Third Kind

Author(s): K.S. Kölbig Library: MATHLIB
Submitter: Submitted: 07.06.1992
Language: Fortran Revised:

Function subprograms RELI1C, RELI2C, RELI3C and DELI1C, DELI2C, DELI3C calculate the complete elliptic integrals of the first, second and third kind, respectively.

Function subprograms RELIGC and DELIGC calculate a general complete elliptic integral.

Function subprograms RELIKC, RELIEC and DELIKC, DELIEC calculate the complete elliptic integrals K(k) and E(k).

On CDC and Cray computers, the double-precision versions DELI1C etc. are not available.

Mainly for reasons of numerical stability, the algorithms are based on the following definitions:

First kind:

eqnarray56

Second kind:

eqnarray63

Third kind:

eqnarray70

Note that tex2html_wrap_inline336 . For p < 0, the integral tex2html_wrap_inline340 is defined by its principal value.

The general integral:

eqnarray81

For p < 0, this integral is defined by its principal value. See Notes for special cases.

The functions K(k) and E(k):

eqnarray94

Other common definitions of the complete elliptic integrals and their relations to tex2html_wrap_inline344 , tex2html_wrap_inline346 , tex2html_wrap_inline348 are listed here for convenience ( tex2html_wrap_inline350 ):
First kind:

displaymath352

Second kind:

displaymath354

Third kind:

displaymath356

Structure:

FUNCTION subprograms
User Entry Names:
RELI1C, RELI2C, RELI3C, RELIGC, RELIKC, RELIEC
DELI1C, DELI2C, DELI3C, DELIGC, DELIKC, DELIEC

Obsolete User Entry Names:
ELLICK tex2html_wrap_inline358 RELIKC, ELLICE tex2html_wrap_inline360 RELIEC,
DELLIK tex2html_wrap_inline362 DELIKC, DELLIE tex2html_wrap_inline364 DELIEC

Files Referenced: Unit 6
External References: MTLMTR, ABEND

Usage:

In any arithmetic expression, with tex2html_wrap_inline366 and tex2html_wrap_inline368 ,

RELI1C(AKP) or DELI1C(AKP) has the value tex2html_wrap_inline370 ,
RELI2C(AKP,A,B) or DELI2C(AKP,A,B) has the value tex2html_wrap_inline372 ,
RELI3C(AKP,AK2,P) or DELI3C(AKP,AK2,P) has the value tex2html_wrap_inline374 ,
RELIGC(AKP,P,A,B) or DELIGC(AKP,P,A,B) has the value tex2html_wrap_inline376 ,
RELIKC(AK) or DELIKC(AK) has the value K(k),
RELIEC(AK) or DELIEC(AK) has the value E(k),

where RELI1C etc are of type REAL, DELI1C etc are of type DOUBLE PRECISION, and AKP, AK, AK2, A, B and P have the same type as the function name.

The redundant parameter AK2 in RELI3C and DELI3C permits improved accuracy when tex2html_wrap_inline382 is small, i.e. tex2html_wrap_inline384 . In this case, tex2html_wrap_inline386 should be calculated using higher-precision arithmetic and then truncated before calling the subprogram.

Method:

The evaluation of tex2html_wrap_inline388 , tex2html_wrap_inline390 , tex2html_wrap_inline392 is based on the Landen transformation, that of tex2html_wrap_inline394 on the Bartky transformation. For details, see Ref. 1-3. For K(k) and E(k) Chebyshev approximations are used (see Ref. 4).

Accuracy:

The REAL functions (except on CDC and Cray computers) have full single-precision accuracy. The REAL functions on CDC and Cray, and the DOUBLE PRECISION functions on all computers have an accuracy approximately two significant digits less than the machine precision.

Restrictions:

1. RELI1C and DELI1C: tex2html_wrap_inline400 .
2. RELI2C and DELI2C: tex2html_wrap_inline402 or tex2html_wrap_inline404 and tex2html_wrap_inline406 .
3. RELI3C and DELI3C: AKP*P tex2html_wrap_inline408 0.
4. RELIGC and DELIGC: tex2html_wrap_inline410 .
5. RELIKC and DELIKC: tex2html_wrap_inline412 , RELIEC and DELIEC: tex2html_wrap_inline414 .

Error handling:

Error C347.1: Restriction 1 is not satisfied.
Error C347.2: Restriction 2 is not satisfied.
Error C347.3: Restriction 3 is not satisfied.
Error C347.4: Restriction 4 is not satisfied.
Error C347.5: Restriction 5 is not satisfied.
In all cases, the function value is set equal to zero, and a message is written on Unit 6, unless subroutine MTLSET (N002) has been called.

Notes:

Every linear combination of the three special complete elliptic integrals K(k), E(k), tex2html_wrap_inline420 may be expressed in terms of tex2html_wrap_inline422 :

displaymath424

Special examples are

displaymath426

If tex2html_wrap_inline428 then tex2html_wrap_inline430 will evaluate any linear combination of K(k), E(k), tex2html_wrap_inline436 without cancellation (such as would occur, for example, if (K(k)-E tex2html_wrap_inline440 were to be computed from values of K(k) and E(k) which had been computed separately.

Other functions which can be represented by tex2html_wrap_inline446 are the Jacobian Zeta function tex2html_wrap_inline448 and the Heuman Lambda function tex2html_wrap_inline450 (see Ref. 5):

displaymath452

(Quoted from Ref. 3, slightly modified).

The subprograms for tex2html_wrap_inline454 , tex2html_wrap_inline456 are based on the Algol60 procedures cel1, cel2 in Ref. 1, those for tex2html_wrap_inline458 on cel3 in Ref. 2, and those for tex2html_wrap_inline460 on cel in Ref. 3.

References:

  1. R. Bulirsch, Numerical calculation of elliptic integrals and elliptic functions, Numer. Math. 7 (1965) 78-90.
  2. R. Bulirsch, Numerical calculation of elliptic integrals and elliptic functions II, Numer. Math. 7 (1965) 353-354.
  3. R. Bulirsch, Numerical calculation of elliptic integrals and elliptic functions III, Numer. Math. 13 (1969) 305-315.
  4. W.J. Cody, Chebyshev approximations for the complete elliptic integrals K and E, Math. Comp. 19 (1965) 105-112.
  5. P.F. Byrd and M.D. Friedman, Handbook of elliptic integrals for engineers and scientists, 2nd ed., Springer-Verlag Berlin (1971) 33-37.
tex2html_wrap_inline466

Michel Goossens Tue Jun 4 23:02:00 METDST 1996