pub fn jacobi_zeta<P, E, V>(phi: V, k: V) -> Vwhere
P: Policy,
E: FloatElement + EllipticConsts,
V: FloatVector<Element = E> + SpecializedSpecialMath<E>,Expand description
The Jacobi zeta function $Z(\varphi, k)$.
The oscillating part of the incomplete integral of the second kind (what is left of
$E(\varphi, k)$ once its linear growth is removed):
Z(\varphi, k) = E(\varphi, k) - \frac{E(k)}{K(k)} F(\varphi, k)Odd in phi, pi-periodic, and exactly zero at every multiple of pi/2.
That defining difference is not how it is evaluated. Both terms grow with phi while
Z does not, so the subtraction cancels wherever Z is small, which is near the zeros,
i.e. everywhere the function is most delicate. The Carlson form used instead has no
subtraction in it at all:
Z(\varphi, k) = \frac{k^2 \sin\varphi \cos\varphi \sqrt{1 - k^2\sin^2\varphi}}{3 K(k)}
R_J(0,\ k'^2,\ 1,\ 1 - k^2\sin^2\varphi)and $1 - k^2\sin^2\varphi$ is itself formed as $k'^2 + k^2\cos^2\varphi$, a sum of two
non-negative terms, so it cannot cancel either. Measured against the defining difference
at 40 digits, worst relative error 3.1e-15 over k to 0.999 and |phi| to 4.5.
No sign fixup is needed: sin is odd and every other factor is even in phi, so the
oddness falls out. k = 1 is the one modulus with no Carlson form ($k'^2 = 0$ gives
R_J two zero arguments and K is infinite) and takes the limit
$\sin\varphi\,\operatorname{sign}(\cos\varphi)$ instead.