NAG Library Function Document
nag_jacobian_theta (s21ccc)
1 Purpose
nag_jacobian_theta (s21ccc) returns the value of one of the Jacobian theta functions , , , or for a real argument and non-negative .
2 Specification
| #include <nag.h> |
| #include <nags.h> |
| double |
nag_jacobian_theta (Integer k,
double x,
double q,
NagError *fail) |
|
3 Description
nag_jacobian_theta (s21ccc) evaluates an approximation to the Jacobian theta functions
,
,
,
and
given by
where
and
(the
nome) are real with
. Note that
is undefined if
is an integer, as is
if
is an integer; otherwise,
, for
.
These functions are important in practice because every one of the Jacobian elliptic functions (see
nag_jacobian_elliptic (s21cbc)) 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.,
Abramowitz and Stegun (1972), 16.27) 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_jacobian_theta (s21ccc) 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
.
4 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
5 Arguments
- 1:
k – IntegerInput
-
On entry: the function to be evaluated. Note that is equivalent to .
Constraint:
.
- 2:
x – doubleInput
-
On entry: the argument of the function.
Constraints:
- x must not be an integer when and ;
- must not be an integer when and .
.
- 3:
q – doubleInput
-
On entry: the argument of the function.
Constraint:
.
- 4:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
6 Error Indicators and Warnings
- NE_INFINITE
The evaluation has been abandoned because the function value is infinite.
- NE_INT
On entry, .
Constraint: .
- 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, .
Constraint: .
On entry, .
Constraint: must not be an integer when and .
On entry,
.
Constraint:
x must not be an integer when
and
.
7 Accuracy
In principle nag_jacobian_theta (s21ccc) 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 sin and cos.
None.
9 Example
The example program evaluates at when , and prints the results.
9.1 Program Text
Program Text (s21ccce.c)
9.2 Program Data
Program Data (s21ccce.d)
9.3 Program Results
Program Results (s21ccce.r)