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
MeanFieldHomogenization.EllipticType-generic complete and incomplete elliptic integrals.
Provides the Legendre integrals Number subtype — Float64, ForwardDiff.Dual, BigFloat, SymPy.Sym, Symbolics.Num, and arbitrary user-defined scalar types.
Dispatch table
| Scalar type | Backend |
|---|---|
Float64 | Elliptic.jl (GSL C binding) |
ForwardDiff.Dual | AGM / Carlson (pure arithmetic) |
SymPy.Sym | sympy.elliptic_{k,e,f} via the optional SymPy extension |
Symbolics.Num | AGM / Carlson (arithmetic-only — verbose but correct; user can simplify()) |
any other Number | AGM / 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
ell_K(m) -> TComplete elliptic integral of the first kind
m is the parameter (not the modulus): Number subtype.
MeanFieldHomogenization.Elliptic.ell_E Function
ell_E(m) -> TComplete elliptic integral of the second kind
ell_E(φ, m) -> TIncomplete 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
ell_F(φ, m) -> TIncomplete elliptic integral of the first kind
MeanFieldHomogenization.Elliptic.ell_RF Function
ell_RF(x, y, z) -> TCarlson'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
ell_RD(x, y, z) -> TCarlson's symmetric elliptic integral of the second kind, degenerate in z:
Same type-generic recursion as ell_RF with the additional