mpmath
mpmath copied to clipboard
Jacobi elliptic function for `u = 0`
The Jacobi elliptic functions should satisfy
sn(0,m) == 0
cn(0,m) == 1
dn(0,m) == 1
for any m, see Abramowitz&Stegun, "Handbook of Mathematical Functions", Sec 16.5. This is not the case, however:
mpmath.ellipfun("sn", 0.0, 1.5) # mpc(real='-1.0052557183770872e-22', imag='8.5907335570440845e-23')
mpmath.ellipfun("cn", 0.0, 1.5) # mpc(real='1.0', imag='7.0322008877396214e-20')
mpmath.ellipfun("dn", 0.0, 1.5) # mpc(real='1.0', imag='7.0322008877396214e-20')
Not sure whether this breaks any real code, but it breaks my tests comparing my own code to mpmath. So feel free to leave unanswered.