NAG Library Routine Document
s21ccf
(jactheta_real)
1
Purpose
s21ccf returns the value of one of the Jacobian theta functions , , , or for a real argument and non-negative , via the function name.
2
Specification
Fortran Interface
Real (Kind=nag_wp) | :: | s21ccf | Integer, Intent (In) | :: |
k | Integer, Intent (Inout) | :: |
ifail | Real (Kind=nag_wp), Intent (In) | :: |
x,
q |
|
C Header Interface
#include nagmk26.h
double |
s21ccf_ (
const Integer *k,
const double *x,
const double *q,
Integer *ifail) |
|
3
Description
s21ccf 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
s21cbf) 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.
s21ccf 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: – IntegerInput
-
On entry: denotes the function to be evaluated. Note that is equivalent to .
Constraint:
.
- 2: – Real (Kind=nag_wp)Input
-
On entry: the argument of the function.
- 3: – Real (Kind=nag_wp)Input
-
On entry: the argument of the function.
Constraint:
.
- 4: – IntegerInput/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this argument, the recommended value is
.
When the value is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6
Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
-
On entry, | , |
or | , |
or | , |
or | , |
-
The evaluation has been abandoned because the function value is infinite. The result is returned as the largest machine representable number (see
x02alf).
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See
Section 3.7 in How to Use the NAG Library and its Documentation for further information.
7
Accuracy
In principle the routine 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.
8
Parallelism and Performance
s21ccf is not threaded in any implementation.
None.
10
Example
This example evaluates at when , and prints the results.
10.1
Program Text
Program Text (s21ccfe.f90)
10.2
Program Data
Program Data (s21ccfe.d)
10.3
Program Results
Program Results (s21ccfe.r)