This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug in Jacobi elliptic functions


"Ivan E. Panchenko" wrote:
> 
> When one calculates dn(x) by  gsl_sf_elljac_impl at _exactly_
> one half of its period, dn(0) is returned instead.

Thanks. I missed this.

I have checked in a change to CVS which solves
the problem for the test you submitted, and which
is equally good for the other tests.

However, I am worried that the new method may
fail elsewhere. It would be good to have
more test cases. Unfortunately, I don't
know how to generate good test cases for this. 
Does anybody know where I can find some?

If you are interested in the technical issue,
the problem was a loss of precision in a
difference between angle arguments. I transformed
to a shifted angle which keeps track of small
differences better. The only remaining issue is
whether or not the resulting sin(psi[1]-psi[0])
will suffer loss of precision if psi[1]-psi[0]
gets close to Pi/2. I'm not sure when this
can occur. If this case is precisely
complementary to the cos(phi[1]-phi[0]) case,
then the fix will be easy, just switch between
them when the condition is detected. However,
before inserting that sort of switch, I would
like to know if it is really necessary.


Thanks again Ivan.

-- 
G. Jungman


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]