next up previous index
Next: C347 Complete Elliptic Up: CERNLIB Previous: C345 Zeros of

C346 Elliptic Integrals of First, Second, and Third Kind

Routine ID: C346
Author(s): K.S. KölbigLibrary: MATHLIB
Submitter: Submitted: 07.06.1992
Language: FortranRevised:

Function subprograms RELI1, RELI2, RELI3 and DELI1, DELI2, DELI3 calculate, for real argument x, the elliptic integrals of the first, second and third kind, respectively.

On CDC and Cray computers, the double-precision versions DELI1, DELI2 and DELI3 are not available.

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

First kind:
F1(x,k') = ∫0x{dξ(1+ξ2)(1+k'2ξ2)}(k'2≥0).

Second kind:
F2(x,k',a,b) = ∫0x{a+bξ2(1+ξ2)(1+ξ2)(1+k'2ξ2)} dξ(k'2≥0).

Third kind:
F3(x,k',p) = ∫0x{1+ξ2(1+pξ2)(1+ξ2)(1+k'2ξ2)} dξ(k'2≥0, px2≠-1).

Note that F1(x,k') = F2(x,k',1,1) =F3(x,k',1) . For p < 0, the integral F3 is defined by its principal value.

For the integral of the second kind, a special entry-mode argument is provided which allows F2(x,k',a,b) to be calculated when k'2< 0 , i.e. when k' is imaginary.

Other common definitions of the elliptic integrals and their relations to F1 , F2 , F3 are listed here for convenience (k2+k'2=1 ):

First kind:
F(k,φ) = ∫0φ{dψ1-k2sin2ψ} = F1(tanφ,k')(|φ| ≤π/2, |k| < 1),

F(y,k) = ∫0y{dη(1-η2)(1-k2η2)} = F1( y/1-y2,k' )(|y| < 1, |k| < 1).

Second kind:
E(k,φ) = ∫0φ1-k2sin2ψ dψ = F2(tanφ,k',1,k'2)(|φ| ≤π/2, |k| ≤1),

E(y,k) = ∫0y{1-k2η21-η2} dη = F2( y/1-y2,k',1,k'2)(|y| < 1, |k| ≤1).

Third kind:

Π(φ,h,k) = 0φ{dψ(1+hsin2ψ)1-k2sin2ψ} = F3(tanφ,k',h+1)

(|φ| ≤π/2, |k| < 1),

Π(y,h,k) = 0y{dη(1+hη2)(1-η2)(1-k2η2)} = F3( y/1-y2,k',h+1 )

(|y| < 1, |k| < 1).

Structure:

FUNCTION subprograms
User Entry Names: RELI1, RELI2, RELI3, DELI1, DELI2, DELI3
Files Referenced: Unit 6
External References: ASINH, DASINH (B102), MTLMTR (N002), ABEND (Z035)

Usage:

In any arithmetic expression, with AKP=k' ,
RELI1(X,AKP)DELI1(X,AKP)F1(X,k') ,
RELI2(X,AKP,A,B,MODE)DELI2(X,AKP,A,B,MODE)F2(X,k'',A,B) ,
RELI3(X,AKP,P)DELI3(X,AKP,P)F3(X,k',P) ,

where RELI1, RELI2, RELI3 are of type REAL, where DELI1, DELI2, DELI3 are of type DOUBLE PRECISION, and X, AKP, A, B and P have the same type as the function name. MODE is of type INTEGER.

The notation k'' indicates that, when calling RELI2 or DRELI2, the parameters AKP and MODE must be set as follows:
If k'2> 0 : MODE = +1 and AKP= k' ,
if k'2< 0 : MODE = -1 and AKP= Im k' = -ik'

(real).

Method:

The evaluation of F1 and F2 is based on the Landen transformation, that of F3 on the Bartky transformation. F2 for k'2< 0 is calculated by using a transformation of the arguments. See Ref. 1 and 2 for details.

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. RELI2 and DELI2: \ AKP*X**2 < 1 if MODE =-1.
2. RELI2 and DELI2: \ MODE = +1 or -1 .
3. RELI3 and DELI3: P*X**2 ≠- 1.

Error handling:

Error C346.1: Restriction 1 is not satisfied.
Error C346.2: Restriction 2 is not satisfied.
Error C346.3: Restriction 3 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.

The subprograms are based on the Algol60 procedures el1, el2 in Ref. 1 and el3 in Ref. 2.

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 III, Numer. Math. 13 (1969) 305--315.

C347



next up previous index
Next: C347 Complete Elliptic Up: CERNLIB Previous: C345 Zeros of


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995