[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gsl] Re: [Help-gsl] Hypergeometric function
From: |
Imad-Eddine Srairi |
Subject: |
Re: [Bug-gsl] Re: [Help-gsl] Hypergeometric function |
Date: |
Fri, 04 Feb 2011 17:19:32 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 |
Hi,
I could not manage to fix this problem yet, but I have tried to narrow
down its location. We are here in a special case where conditions of [1]
are fulfilled i.e.:
a = -0.5 , b = 1.5 , c = 1.0
and : c = 0.5 * a + 0.5 * b + 0.5.
It is easy to check the two results returned by the test case attached
to this issue against:
M_SQRTPI * gsl_sf_gamma(1.0) / gsl_sf_gamma(0.25) / gsl_sf_gamma(1.25);
to find that the correct answer is the positive one (the one returned
for (1/2 - epsilon)) and that the error lies in the (1/2 + epsilon) case.
The result returned in this case is produced by call to this function
return hyperg_2F1_reflect(a, b, c, x, result);
which seems to rely on this reference:
/* Do the reflection described in [Moshier, p. 334].
* Assumes a,b,c != neg integer.
*/
I have no access to this book, but I am currently trying to match the
code against the special cases described in [2].
The result is computed in these lines:
sgn_2 = ( GSL_IS_ODD(intd) ? -1.0 : 1.0 );
result->val = F1.val + sgn_2 * F2.val;
result->err = F1.err + F2. err;
result->err += 2.0 * GSL_DBL_EPSILON * (fabs(F1.val) + fabs(F2.val));
result->err += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
return stat_F2;
with sgn_2 = 1.0, F1.val = 0.0 and F2.val = -0.538171 .
Hope this helps,
imad
[1] http://dlmf.nist.gov/15.4#E28
[2] http://dlmf.nist.gov/15.8#SS1.p1
On 01/31/2011 05:46 PM, Brian Gough wrote:
At Thu, 27 Jan 2011 20:38:28 +0100,
Paola Alpresa GutiƩrrez wrote:
In a general case of gsl_sf_hyperg_2F1(-nu,nu+1,1,x): the function sign is
correct for x<1/2, but it is minus the function for x>=1/2.
There is a discontinuity in z=0 or x=1/2, if I am correct. I compared it
with Mathematica.
Thanks for the bug report, I've confirmed that there is a sign problem there.
- Re: [Bug-gsl] Re: [Help-gsl] Hypergeometric function,
Imad-Eddine Srairi <=