Skip to main content

ellint_impl

Function ellint_impl 

Source
pub fn ellint_impl<P, E, V, const KIND: u8, const COMPLETE: bool>(
    phi: V,
    k: V,
    n: V,
) -> V
Expand description

Legendre elliptic integral, const-generic over kind and completeness.

KIND is one of KIND_F, KIND_E, KIND_D, KIND_PI. COMPLETE selects phi = pi/2 (the AGM path for F/E/D, Carlson R_F+R_J for Pi); otherwise the incomplete form is evaluated via Carlson at a range-reduced amplitude. Argument is the modulus k; n is the characteristic, used only by the third kind (KIND_PI).

Incomplete amplitudes are reduced into [-pi/2, pi/2] using the quasi-period identity I(phi + m*pi) = I(phi) + 2m * I_complete (the integrands have period pi, and one full period equals twice the complete value). Reduction by phi - m*pi loses precision for very large |phi| (argument cancellation); a Cody-Waite split would extend the range.

Last built: 2026-09-08 21:35:55 UTC