The y = jacobian_theta(k, x, q) computes the value of one of the Jacobian theta functions , , , or for a real argument x and non-negative q ≤ 1.
The routine evaluates an approximation to the Jacobian theta functions , , , and given by
where x and q are real with 0 ≤ q ≤ 1. Note that is undefined if is an integer, as is if x is an integer. Otherwise, , for .
For more information please refer to the s21ccc function in the NAG document.
- k (input, integer)
- The function (x,q) to be evaluated. Note that k=4 is equivalent to k=0.
- Constraint: 0 ≤ k ≤ 4.
- x (input, double)
- The argument x of the function.
- Constraints: x must not be an integer when q=1.0 and k=2; (x-0.5) must not be an integer when q=1.0 and k=1.
- q (input, double)
- The argument q of the function.
- Constraint: 0.0 ≤ q ≤ 1.0.
- y (output, double)
- The return value of one of the Jacobian theta functions.