## #2615 Numeric evaluation of inverse Jacobi elliptic functions is wrong for some inputs

None
open
7
2013-09-18
2013-07-26
No

Numeric evaluation of inverse Jacobi elliptic functions is wrong for some inputs. For example,

(%i6) jacobi_dn(float(inverse_jacobi_dn(-2, 3)), 3);
(%o6)           2.0000000000000004 - 2.4980018054066022e-16 %i

is clearly wrong; it should be -2, as you can see with the symbolic simplification:

(%i1) jacobi_dn(inverse_jacobi_dn(-2, 3), 3);
(%o1)                                 - 2

The reason for this problem is that inverse_jacobi_dn is computed as inverse_jacobi_dn(u, m)=elliptic_f(asin(sqrt((1 - u^2)/m)), m). Since that function is even in u, inverse_jacobi_dn(-2, 3)=inverse_jacobi_dn(2, 3), which is wrong. It should be computed in some other way.

Presumably this problem will also cause errors with some of the other inverse Jacobi functions, since I think some are defined in terms of inverse_jacobi_dn for numeric evaluation.

## Discussion

• Raymond Toy - 2013-08-11

Thanks for the bug report and analysis. You are right. Some different method needs to be used.

I also notice that there are lots of other issues with inverse elliptic functions. It will take some time to sort this all out.

• Raymond Toy - 2013-08-11
• labels: --> Lisp Core - Floating point

• Raymond Toy - 2013-09-06

A new implementation of inverse_jacobi_dn has been checked in. Please test this, if you can.

The new version uses the relationship

dn(z | m) = cn(sqrt(m)*z | 1/m)

• Eviatar Bach - 2013-09-18

Great! I'll test this when I get a chance.