bug-gsl
[Top][All Lists]

## [Bug-gsl] [bug #41837] bugs in gsl_sf_hyperg_U

 From: Raymond Rogers Subject: [Bug-gsl] [bug #41837] bugs in gsl_sf_hyperg_U Date: Fri, 14 Mar 2014 18:20:06 +0000 User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36

```Follow-up Comment #4, bug #41837 (project gsl):

Caveat: I am not experienced enough to be a maintainer for this code and have
just looked into this particular problem.
It needs a more professional eye.
This was analyzed with ddd/gdb on Linux Mint.

I have looked into this and the problem seems to be in:
hyperg_U.c
In this section:

gsl_sf_result sum;
int stat_sum = hyperg_U_finite_sum(N, a, b, x, xeps, &sum);
int stat_inf;

/* Evaluate infinite sum. */
if(fabs(xeps-1.0) > 0.5 ) {
stat_inf = hyperg_U_infinite_sum_stable(N, a, bint, b, beps, x, xeps,
sum, result);
} else if (1+a-b < 0 && 1+a-b==floor(1+a-b) && beps != 0) {
stat_inf = hyperg_U_infinite_sum_simple(N, a, bint, b, beps, x, xeps,
sum, result);
} else {
stat_inf = hyperg_U_infinite_sum_improved(N, a, bint, b, beps, x, xeps,
sum, result);
}

What happens is that when a-b+1=-n  then a finite condition 1-b+1= -n  is
satisfied and the finite sum succeeds; as it supposed to.
But the program continues to the hyperg_U_infinite_sum_simple where that
condition is a no..no and bombs in gamma.c deep inside so it never gets back
to check if the finite sum worked.
What should happen is the success of the finite sum should skip the latter
tests
Recommendation: If the finite sum succeeded skip the infinite sum tests (and
execution).

_______________________________________________________

<http://savannah.gnu.org/bugs/?41837>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/

```