PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_specfun_jactheta_real (s21cc)
Purpose
nag_specfun_jactheta_real (s21cc) returns the value of one of the Jacobian theta functions , , , or for a real argument and non-negative , via the function name.
Syntax
Description
nag_specfun_jactheta_real (s21cc) evaluates an approximation to the Jacobian theta functions
,
,
,
and
given by
where
and
(the
nome) are real with
.
These functions are important in practice because every one of the Jacobian elliptic functions (see
nag_specfun_jacellip_complex (s21cb)) can be expressed as the ratio of two Jacobian theta functions (see
Whittaker and Watson (1990)). There is also a bewildering variety of notations used in the literature to define them. Some authors (e.g., Section 16.27 of
Abramowitz and Stegun (1972)) define the argument in the trigonometric terms to be
instead of
. This can often lead to confusion, so great care must therefore be exercised when consulting the literature. Further details (including various relations and identities) can be found in the references.
nag_specfun_jactheta_real (s21cc) is based on a truncated series approach. If
differs from
or
by an integer when
, it follows from the periodicity and symmetry properties of the functions that
and
. In a region for which the approximation is sufficiently accurate,
is set equal to the first term (
) of the transformed series
and
is set equal to the first two terms (i.e.,
) of
where
. Otherwise, the trigonometric series for
and
are used. For all values of
,
and
are computed from the relations
and
.
References
Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Byrd P F and Friedman M D (1971) Handbook of Elliptic Integrals for Engineers and Scientists pp. 315–320 (2nd Edition) Springer–Verlag
Magnus W, Oberhettinger F and Soni R P (1966) Formulas and Theorems for the Special Functions of Mathematical Physics 371–377 Springer–Verlag
Tølke F (1966) Praktische Funktionenlehre (Bd. II) 1–38 Springer–Verlag
Whittaker E T and Watson G N (1990) A Course in Modern Analysis (4th Edition) Cambridge University Press
Parameters
Compulsory Input Parameters
- 1:
– int64int32nag_int scalar
-
Denotes the function to be evaluated. Note that is equivalent to .
Constraint:
.
- 2:
– double scalar
-
The argument of the function.
- 3:
– double scalar
-
The argument of the function.
Constraint:
.
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.
-
-
On entry, | , |
or | , |
or | , |
or | , |
- W
-
The evaluation has been abandoned because the function value is infinite. The result is returned as the largest machine representable number (see
nag_machine_real_largest (x02al)).
-
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 the function is capable of achieving full relative precision in the computed values. However, the accuracy obtainable in practice depends on the accuracy of the standard elementary functions such as sin and cos.
Further Comments
None.
Example
This example evaluates at when , and prints the results.
Open in the MATLAB editor:
s21cc_example
function s21cc_example
fprintf('s21cc example results\n\n');
k = int64(2);
x = 0.7;
q = 0.4;
[result, ifail] = s21cc(k, x, q);
fprintf('%3s%7s%7s%16s\n','k','x','q','theta_k(x,q)');
fprintf('%3d %7.2f%7.2f%14.4e\n',k,x,q,result);
s21cc example results
k x q theta_k(x,q)
2 0.70 0.40 -6.9289e-01
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015