NAG Library Routine Document
S21CBF evaluates the Jacobian elliptic functions ,
and for a complex argument .
||Z, SN, CN, DN
S21CBF evaluates the Jacobian elliptic functions
is a complex argument,
is a real parameter (the modulus
) is defined by the integral
The above definitions can be extended for values of
(see Salzer (1962)
) by means of the formulae
Special values include
These functions are often simply written as
, thereby avoiding explicit reference to the parameter
. They can also be expressed in terms of Jacobian theta functions (see S21CCF
Another nine elliptic functions may be computed via the formulae
(see Abramowitz and Stegun (1972)
The values of
are obtained by calls to S21CAF
. Further details can be found in Section 8
Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Salzer H E (1962) Quick calculation of Jacobian elliptic functions Comm. ACM 5 399
- 1: Z – COMPLEX (KIND=nag_wp)Input
On entry: the argument of the functions.
- , where .
- 2: AK2 – REAL (KIND=nag_wp)Input
On entry: the value of .
- 3: SN – COMPLEX (KIND=nag_wp)Output
- 4: CN – COMPLEX (KIND=nag_wp)Output
- 5: DN – COMPLEX (KIND=nag_wp)Output
On exit: the values of the functions , and , respectively.
- 6: IFAIL – INTEGERInput/Output
must be set to
. If you are unfamiliar with this parameter you should refer to Section 3.3
in the Essential Introduction 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 parameter, the recommended value is
. When the value is used it is essential to test the value of IFAIL 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
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Errors or warnings detected by the routine:
|or||, where .|
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.
The values of
are computed via the formulae
(the complementary modulus
This example evaluates , and at when , and prints the results.
9.1 Program Text
Program Text (s21cbfe.f90)
9.2 Program Data
Program Data (s21cbfe.d)
9.3 Program Results
Program Results (s21cbfe.r)