1

I have a problem to check the validity of an algorithm I've implemented in C++ to compute the Jacobi elliptic function $\mathrm{sn}(u, k)$ (inspired and improved from Numerical Recipes 3rd edition). I would like to test my algorithm for $u=0.2$ and $k=0.5$. I obtain the following results:

  • C++ (double precision): $\mathrm{sn}(0.2, 0.5) = 0.198345391214472$
  • Maple: $\mathrm{sn}(0.2, 0.5) = 0.198345391214472$
  • Wolfram Alpha: $\mathrm{sn}(0.2, 0.5) = 0.198021742981970$

My result is consistent with the result of Maple. But my big problem is that Maple and Wolfram Alpha do not give the same value...

So what is the exact value of the 15 first decimals of $\mathrm{sn}(0.2, 0.5)$ ?

Vincent
  • 1,425

1 Answers1

8

Alpha will give you the same $0.1983453912\cdots$ result with $\ \operatorname{sn}(0.2,0.5^2)$

Mathematica and the old and excellent reference Abramowitz&Stegun use the 'parameter' $m=k^2$ instead of the 'modulus' $k$ used by your code, Maple, MATLAB and many other online references like Dlmf and MathWorld which is used when you click at the right on 'Definition' in... Alpha !

ADDITION: A fine discussion about this problem as well as the notation allowing a clear distinction between the conventions in use was given by J. M. here.

Raymond Manzoni
  • 43,021
  • 5
  • 86
  • 140