hi
i have come across a bug in ellint.c (special functions)
function gsl_sf_ellint_Pcomp_e(double k, double n, gsl_mode_t mode,
gsl_sf_result * result)
the signs are interchanged on the following lines:
the lines:
const int rjstatus = gsl_sf_ellint_RJ_e(0.0, y, 1.0, 1.0 + n, mode, &rj);
result->val = rf.val - (n/3.0) * rj.val;
should be
const int rjstatus = gsl_sf_ellint_RJ_e(0.0, y, 1.0, 1.0 - n, mode, &rj);
result->val = rf.val + (n/3.0) * rj.val;
From Wikipedia
K(k)=R_F\left(0,1-k^2,1\right)
E(k)=R_F\left(0,1-k^2,1\right)-\frac{1}{3}k^2 R_D\left(0,1-k^2,1\right)
\Pi(n,k)=R_F\left(0,1-k^2,1\right)+\frac{1}{3}n R_J
\left(0,1-k^2,1,1-n\right)
great library.
cheers
tim
_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl