nag_general_elliptic_integral_f  (s21dac) (PDF version)
s Chapter Contents
s Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_general_elliptic_integral_f  (s21dac)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_general_elliptic_integral_f  (s21dac) returns the value of the general elliptic integral of the second kind F z, k ,a,b  for a complex argument z .

2  Specification

#include <nag.h>
#include <nags.h>
Complex  nag_general_elliptic_integral_f  (Complex z, double akp, double a, double b, NagError *fail)

3  Description

nag_general_elliptic_integral_f  (s21dac) evaluates an approximation to the general elliptic integral of the second kind F z, k ,a,b  given by
F z, k ,a,b = 0 z a + b ζ 2 1 + ζ 2 1 + ζ 2 1 + k 2 ζ 2 d ζ ,
where a  and b  are real arguments, z  is a complex argument whose real part is non-negative and k  is a real argument (the complementary modulus). The evaluation of F  is based on the Gauss transformation. Further details, in particular for the conformal mapping provided by F , can be found in Bulirsch (1960).
Special values include
F z, k ,1,1 = 0 z dζ 1 + ζ 2 1 + k 2 ζ 2 ,
or F 1 z, k  (the elliptic integral of the first kind) and
F z, k ,1, k 2 = 0 z 1 + k 2 ζ 2 1 + ζ 2 1 + ζ 2 d ζ ,
or F 2 z, k  (the elliptic integral of the second kind). Note that the values of F 1 z, k  and F 2 z, k  are equal to tan -1 z  in the trivial case k = 1 .
nag_general_elliptic_integral_f  (s21dac) is derived from a procedure given by Bulirsch (1960).
Constraints are placed on the values of z  and k  in order to avoid the possibility of machine overflow.

4  References

Bulirsch R (1960) Numerical calculation of elliptic integrals and elliptic functions Numer. Math. 7 76–90

5  Arguments

1:     zComplexInput
On entry: the argument z  of the function.
Constraints:
  • 0.0 z.re λ ;
  • z.im λ , where λ 6 = 1 / nag_real_safe_small_number .
2:     akpdoubleInput
On entry: the argument k  of the function.
Constraint: akp λ , where λ 6 = 1 / nag_real_safe_small_number .
3:     adoubleInput
On entry: the argument a  of the function.
4:     bdoubleInput
On entry: the argument b  of the function.
5:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_COMPLEX
On entry, z = value,value .
Constraints:
0.0 z.re λ ;
z.im λ , where λ 6 = 1 / nag_real_safe_small_number .
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_REAL
On entry, akp=value.
Constraint: akpλ, where λ 6 = 1 / nag_real_safe_small_number .
NE_S21_CONV
The iterative procedure used to evaluate the integral has failed to converge. The result is returned as zero.

7  Accuracy

In principle nag_general_elliptic_integral_f  (s21dac) is capable of achieving full relative precision in the computed values. However, the accuracy obtainable in practice depends on the accuracy of the C standard library elementary functions such as atan2 and log.

8  Further Comments

None.

9  Example

The example program evaluates the elliptic integral of the first kind F 1 z, k  given by
F 1 z, k = 0 z dζ 1 + ζ 2 1 + k 2 ζ 2 ,
where z = 1.2 + 3.7 i  and k = 0.5 , and prints the results.

9.1  Program Text

Program Text (s21dace.c)

9.2  Program Data

Program Data (s21dace.d)

9.3  Program Results

Program Results (s21dace.r)


nag_general_elliptic_integral_f  (s21dac) (PDF version)
s Chapter Contents
s Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012