PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_specfun_ellipint_legendre_3 (s21bg)
Purpose
nag_specfun_ellipint_legendre_3 (s21bg) returns a value of the classical (Legendre) form of the incomplete elliptic integral of the third kind, via the function name.
Syntax
Description
nag_specfun_ellipint_legendre_3 (s21bg) calculates an approximation to the integral
where
,
,
and
may not both equal one, and
.
The integral is computed using the symmetrised elliptic integrals of Carlson (
Carlson (1979) and
Carlson (1988)). The relevant identity is
where
,
,
,
is the Carlson symmetrised incomplete elliptic integral of the first kind (see
nag_specfun_ellipint_symm_1 (s21bb)) and
is the Carlson symmetrised incomplete elliptic integral of the third kind (see
nag_specfun_ellipint_symm_3 (s21bd)).
References
Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Carlson B C (1979) Computing elliptic integrals by duplication Numerische Mathematik 33 1–16
Carlson B C (1988) A table of elliptic integrals of the third kind Math. Comput. 51 267–280
Parameters
Compulsory Input Parameters
- 1:
– double scalar
- 2:
– double scalar
- 3:
– double scalar
-
The arguments , and of the function.
Constraints:
- ;
- ;
- Only one of and dm may be ;
- .
Note that is allowable, as long as .
Optional Input Parameters
None.
Output Parameters
- 1:
– double scalar
The result of the function.
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
-
-
Constraint: .
-
-
Constraint: .
- W
-
On entry, and ; the integral is infinite.
- W
-
Constraint: .
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
In principle
nag_specfun_ellipint_legendre_3 (s21bg) is capable of producing full
machine precision. However round-off errors in internal arithmetic will result in slight loss of accuracy. This loss should never be excessive as the algorithm does not involve any significant amplification of round-off error. It is reasonable to assume that the result is accurate to within a small multiple of the
machine precision.
Further Comments
You should consult the
S Chapter Introduction, which shows the relationship between this function and the Carlson definitions of the elliptic integrals. In particular, the relationship between the argument-constraints for both forms becomes clear.
For more information on the algorithms used to compute
and
, see the function documents for
nag_specfun_ellipint_symm_1 (s21bb) and
nag_specfun_ellipint_symm_3 (s21bd), respectively.
If you wish to input a value of
phi outside the range allowed by this function you should refer to Section 17.4 of
Abramowitz and Stegun (1972) for useful identities.
Example
This example simply generates a small set of nonextreme arguments that are used with the function to produce the table of results.
Open in the MATLAB editor:
s21bg_example
function s21bg_example
fprintf('s21bg example results\n\n');
dn = [0.1 -0.2 0.3];
phi = [pi/6 pi/3 pi/2];
dm = [1/4 1/2 3/4];
result = phi;
for j = 1:numel(phi)
[result(j), ifail] = s21bg(dn(j), phi(j), dm(j));
end
fprintf(' n phi m Pi(n;phi|m)\n');
fprintf(' %7.2f %7.2f %7.2f %12.4f\n', [dn; phi; dm; result]);
s21bg example results
n phi m Pi(n;phi|m)
0.10 0.52 0.25 0.5341
-0.20 1.05 0.50 1.0778
0.30 1.57 0.75 2.6568
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015