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 s21cbc (nag_jacobian_elliptic)) 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
.