where x and q (the nome) are real with 0≤q≤1. Note that θ1x-12,1 is undefined if x-12 is an integer, as is θ2x,1 if x is an integer; otherwise, θix,1=0, for i=0,1,…,4.

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 x instead of πx. 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 t differs from x or -x by an integer when 0≤t≤12, it follows from the periodicity and symmetry properties of the functions that θ1x,q=±θ1t,q and θ3x,q=±θ3t,q. In a region for which the approximation is sufficiently accurate, θ1 is set equal to the first term n=0 of the transformed series

θ1t,q=2λπe-λt2∑n=0∞-1ne-λn+122sinh2n+1λt

and θ3 is set equal to the first two terms (i.e., n≤1) of

θ3t,q=λπe-λt21+2∑n=1∞e-λn2cosh2nλt,

where λ=π2/loge⁡q. Otherwise, the trigonometric series for θ1t,q and θ3t,q are used. For all values of x, θ0 and θ2 are computed from the relations θ0x,q=θ312-x,q and θ2x,q=θ112-x,q.

6 Error Indicators and Warnings

The evaluation has been abandoned because the function value is infinite.

NE_INT

On entry, k=value.
Constraint: 0≤k≤4.

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, q=value.
Constraint: 0.0≤q≤1.0.

On entry, x=value.
Constraint: x-0.5 must not be an integer when q=1.0 and k=1.

On entry, x=value.
Constraint: x must not be an integer when q=1.0 and k=2.

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.

8 Further Comments

None.

9 Example

The example program evaluates θ2x,q at x=0.7 when q=0.4, and prints the results.