This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/66689] comp_ellint_3 and ellint_3 return garbage values
- From: "john at johnmaddock dot co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 28 Jun 2015 12:32:38 +0000
- Subject: [Bug libstdc++/66689] comp_ellint_3 and ellint_3 return garbage values
- Auto-submitted: auto-generated
- References: <bug-66689-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66689
--- Comment #1 from John Maddock <john at johnmaddock dot co.uk> ---
I think I've found the problem - make the nu parameter negative and you get the
correct answers.
These functions appear to use the same definition for ellint_3 as GSL uses
(same code?), but TR1 uses a different one which matches A&S: note the change
of sign in the nu parameter in the integral:
GSL has Pi(\phi,k,n) = \int_0^\phi dt 1/((1 + n \sin^2(t))\sqrt(1 - k^2
\sin^2(t)))
TR1 has Pi(\phi,k,n) = \int_0^\phi dt 1/((1 - n \sin^2(t))\sqrt(1 - k^2
\sin^2(t)))