...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The main reference for the elliptic integrals is:
M. Abramowitz and I. A. Stegun (Eds.) (1964) Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, National Bureau of Standards Applied Mathematics Series, U.S. Government Printing Office, Washington, D.C.
and its recently revised version NIST Digital Library of Mathematical Functions (DMLF), in particular
Mathworld also contain a lot of useful background information:
As does Wikipedia Elliptic integral.
All variables are real numbers unless otherwise noted.
is called elliptic integral if R(t, s) is a rational function of t and s, and s^{2} is a cubic or quartic polynomial in t.
Elliptic integrals generally cannot be expressed in terms of elementary functions. However, Legendre showed that all elliptic integrals can be reduced to the following three canonical forms:
Elliptic Integral of the First Kind (Legendre form)
Elliptic Integral of the Second Kind (Legendre form)
Elliptic Integral of the Third Kind (Legendre form)
where
Note | |
---|---|
φ is called the amplitude. k is called the elliptic modulus or eccentricity. α is called the modular angle. n is called the characteristic. |
Caution | |
---|---|
Perhaps more than any other special functions the elliptic integrals are expressed in a variety of different ways. In particular, the final parameter k (the modulus) may be expressed using a modular angle α, or a parameter m. These are related by:
So that the integral of the third kind (for example) may be expressed as either:
To further complicate matters, some texts refer to the complement of the parameter m, or 1 - m, where:
This implementation uses k throughout: this matches
the requirements of the Technical
Report on C++ Library Extensions. So you should be extra careful when using these functions! |
Warning | |
---|---|
Boost.Math order of arguments differs from other implementations: k is always the first argument. |
A simple example comparing use of Wolfram Alpha with Boost.Math (including much higher precision using Boost.Multiprecision) is jacobi_zeta_example.cpp.
When φ = π / 2, the elliptic integrals are called complete.
Complete Elliptic Integral of the First Kind (Legendre form)
Complete Elliptic Integral of the Second Kind (Legendre form)
Complete Elliptic Integral of the Third Kind (Legendre form)
Legendre also defined a fourth integral /D(φ,k)/ which is a combination of the other three:
Like the other Legendre integrals this comes in both complete and incomplete forms.
Carlson [Carlson77] [Carlson78] gives an alternative definition of elliptic integral's canonical forms:
Carlson's Elliptic Integral of the First Kind
where x, y, z are nonnegative and at most one of them may be zero.
Carlson's Elliptic Integral of the Second Kind
where x, y are nonnegative, at most one of them may be zero, and z must be positive.
Carlson's Elliptic Integral of the Third Kind
where x, y, z are nonnegative, at most one of them may be zero, and p must be nonzero.
Carlson's Degenerate Elliptic Integral
where x is nonnegative and y is nonzero.
Note | |
---|---|
R_{C}(x, y) = R_{F}(x, y, y) R_{D}(x, y, z) = R_{J}(x, y, z, z) |
Carlson's Symmetric Integral
Carlson proved in [Carlson78] that
The Legendre form and Carlson form of elliptic integrals are related by equations:
In particular,
There are two functions related to the elliptic integrals which otherwise defy categorisation, these are the Jacobi Zeta function:
and the Heuman Lambda function:
Both of these functions are easily implemented in terms of Carlson's integrals, and are provided in this library as jacobi_zeta and heuman_lambda.
The conventional methods for computing elliptic integrals are Gauss and Landen transformations, which converge quadratically and work well for elliptic integrals of the first and second kinds. Unfortunately they suffer from loss of significant digits for the third kind.
Carlson's algorithm [Carlson79] [Carlson78], by contrast, provides a unified method for all three kinds of elliptic integrals with satisfactory precisions.
Special mention goes to:
A. M. Legendre, Traité des Fonctions Elliptiques et des Integrales Euleriennes, Vol. 1. Paris (1825).
However the main references are:
The following references, while not directly relevant to our implementation, may also be of interest: