Skip to content

Elliptic integrals — API

The MeanFieldHomogenization.Elliptic submodule. All five public names are re-exported at the top level (using MeanFieldHomogenization brings them into scope directly).

MeanFieldHomogenization.Elliptic Module
julia
MeanFieldHomogenization.Elliptic

Type-generic complete and incomplete elliptic integrals.

Provides the Legendre integrals , , , and Carlson's symmetric integrals , in a form that works for every Number subtype — Float64, ForwardDiff.Dual, BigFloat, SymPy.Sym, Symbolics.Num, and arbitrary user-defined scalar types.

Dispatch table

Scalar typeBackend
Float64Elliptic.jl (GSL C binding)
ForwardDiff.DualAGM / Carlson (pure arithmetic)
SymPy.Symsympy.elliptic_{k,e,f} via the optional SymPy extension
Symbolics.NumAGM / Carlson (arithmetic-only — verbose but correct; user can simplify())
any other NumberAGM / Carlson

Users can add methods to ell_K, ell_E, ell_F, ell_RF, ell_RD for their own number types — downstream callers will automatically pick them up.

References

  • AGM for : Abramowitz & Stegun 17.6, NIST DLMF 19.8.

  • Carlson's symmetric integrals: B.C. Carlson, Numerical computation of real or complex elliptic integrals, Numerical Algorithms 10 (1995) 13-26.

  • Iterative duplication scheme: public-domain SLATEC routines DRF / DRD (B.C. Carlson and E.M. Notis, Ames Laboratory, 1981).

MeanFieldHomogenization.Elliptic.ell_K Function
julia
ell_K(m) -> T

Complete elliptic integral of the first kind  .

m is the parameter (not the modulus):  . Type-generic: works with any Number subtype.

MeanFieldHomogenization.Elliptic.ell_E Function
julia
ell_E(m) -> T

Complete elliptic integral of the second kind   .

julia
ell_E(φ, m) -> T

Incomplete elliptic integral of the second kind   .

The 1-argument ell_E(m) (complete integral) and the 2-argument ell_E(φ, m) (incomplete integral) coexist via arity dispatch — identical to the convention of Elliptic.jl.

MeanFieldHomogenization.Elliptic.ell_F Function
julia
ell_F(φ, m) -> T

Incomplete elliptic integral of the first kind  .

MeanFieldHomogenization.Elliptic.ell_RF Function
julia
ell_RF(x, y, z) -> T

Carlson's symmetric elliptic integral of the first kind,

     .

Type-generic: the duplication recursion uses only arithmetic and square roots, so it extends unchanged to BigFloat, ForwardDiff.Dual, Symbolics.Num, SymPy.Sym, and any other Number subtype.

MeanFieldHomogenization.Elliptic.ell_RD Function
julia
ell_RD(x, y, z) -> T

Carlson's symmetric elliptic integral of the second kind, degenerate in z:

   .

Same type-generic recursion as ell_RF with the additional -weighted mean and a running sum that accounts for the degenerate   factor (Carlson 1995 §2).

Index