[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gsl] bug in ellint.c
From: |
tim |
Subject: |
[Bug-gsl] bug in ellint.c |
Date: |
Fri, 11 Sep 2009 19:28:59 +1200 |
User-agent: |
Thunderbird 1.5.0.12 (X11/20080430) |
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] bug in ellint.c,
tim <=