This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Bug in Jacobi elliptic functions
- To: "Ivan E. Panchenko" <ivan at xray dot sai dot msu dot ru>
- Subject: Re: Bug in Jacobi elliptic functions
- From: Gerard Jungman <jungman at lanl dot gov>
- Date: Fri, 27 Apr 2001 12:45:38 -0600
- CC: gsl-discuss at sources dot redhat dot com
- Organization: LANL T-3
- References: <Pine.LNX.4.21.0104260756200.5090-100000@xray.sai.msu.ru>
"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