bugGNU Scientific Library - Bugs: bug #50713, Non termination of the incomplete...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #50713: Non termination of the incomplete gamma function due to floating-point rounding errors

Submitted by:  Patrick Alken <psa>
Submitted on:  Mon 03 Apr 2017 10:05:29 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Operating System: Status: Duplicate
Assigned to: NoneOpen/Closed: Closed
Release: 

Mon 03 Apr 2017 10:06:11 PM UTC, comment #1:

duplicate of #50459

Patrick Alken <psa>
Project Administrator
Mon 03 Apr 2017 10:05:29 PM UTC, original submission:

from maurica =dot= fonenantsoa =at= gmail =dot= com

Bug of non termination of the incomplete gamma function due to
floating-point rounding errors in GSL 2.3

The function
int gsl_sf_gamma_inc_e(const double a, const double x, gsl_sf_result*
result) from gsl/gsl_sf_gamma.h
does not terminate for any value of a and x such that a < -2^52 && 0 < x <=
0.25

For example, the call to gsl_sf_gamma_inc_e in the following program:
#include <stdio.h>
#include <gsl/gsl_sf_gamma.h>
int main (void)
{
double a = -1E25, x = 0.1;
gsl_sf_result* result;
printf ("%i\n", gsl_sf_gamma_inc_e(a, x, result));
return 0;
}

does not terminate as explained below:
int gsl_sf_gamma_inc_e(const double a, const double x, gsl_sf_result*
result)
{
...
else
{
...
double alpha = da; // alpha = 0
...
do
{
...
alpha -= 1.0; // when alpha reaches -2^-52 (~4.5E15)
// then alpha - 1 is rounded to alpha itself
// thus alpha will not be updated anymore
} while(alpha > a); // a = -1E25
...
}
}

To guarantee termination for any possible input, the case a < -2^52 && 0 <
x <= 0.25 should be prevented.

Patrick Alken <psa>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psa (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 03 Apr 2017 10:06:11 PM UTCpsaStatusNone=>Duplicate
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1