bugGNU Scientific Library - Bugs: bug #45925, Incomplete Gamma Functions flipped?


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

bug #45925: Incomplete Gamma Functions flipped?

Submitter:  Patrick Alken <psa>
Submitted:  Fri 11 Sep 2015 10:07:55 AM UTC
Category:  Runtime error Severity:  3 - Normal
Operating System:  Status:  None
Assigned to:  None Open/Closed:  Open

Thu 19 Nov 2015 10:22:06 PM UTC, comment #1: 

I've investigated bug #45925 "Incomplete Gamma Functions flipped?" and I believe there is in fact no problem with gsl. The bug author compares the (upper) incomplete gamma function with the function P(a,x) and correctly notes that the values disagree. However the comparison should actually be done with the function Q(a,x) rather than P(a,x), and here the values agree. The definitions for the upper incomplete gamma function and Q(a,x) are contained in the gsl reference document under the section on "Incomplete Gamma Functions". I recommend that no code changes be made and that this bug be closed.

-Bill Maier   

Patrick Alken <psa>
Group administrator
Fri 11 Sep 2015 10:07:55 AM UTC, original submission:  

from vsakharuk =at= hbk =dot= com

Hello all,
Running 32 bit gsl on windows.
Got flipped results for incomplete gamma Functions.

#include <iomanip>
#include <iostream>
#include <gsl\gsl_specfunc.h>

using namespace std;

int main( int argc, char* argv[])
    cout<<"GSL incomplete gamma=" << gsl_sf_gamma_inc(1.000000, 3.000000)<< endl;
    cout<<"GSL incomplete gamma P=" << gsl_sf_gamma_inc_P(1.000000, 3.000000)<< endl;
    return 0;

GSL incomplete gamma=0.0497871
GSL incomplete gamma P=0.950213

IMHO, GSL incomplete gamma should be equal to 0.950213
This is output of incomplete gamma P

Regards V.

Patrick Alken <psa>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code