stla

Results 306 comments of stla

The Klein-j function is defined on the open upper half-plane, ie the upper half plane without the real axis. It is then "normal" that its behaviour is not nice near...

Nice pic. Indeed, it's weird that the problems are concentrated about -1 and 1, and not everywhere along the real axis.

I have the same implementation in R and I found a way which works better sometimes. Instead of ```r x

Just checked with **mpmath**. Results are different. One can also get a different result while we use an equivalent expression of Klein-j. So we cannot trust these results.

@simonp0420 I've ported the new Fortran implementation by @fremling to Haskell and with this implementation the result is immediately obtained! That's impressive. I think I will port it to R/C++...

[Here](https://github.com/fremling/jacobi-theta-function-fortran/blob/master/jacobitheta.f90). He uses the modular transformations to bring $\tau$ to a certain region where the evaluation works.

@simonp0420 I ported the code to R. It works, and better than the previous one!

I ported the code to Julia now: [gist](https://gist.github.com/stla/a3b784c11419d8ef1179c9235ed18595). It works!

Thanks! I'm not an expert in elliptic integrals and I don't understand what is going on here. I will implement `ellipticK` from the AGM.

Ah I've just had a thought. In the new `_jtheta1dash0`, there is a call to the generalized Jacobi theta function with a value `1/6`. Maybe we should promote the type...