bugGNU Scientific Library - Bugs: bug #21836, gamma_inc_P and gamma_inc_Q only...

 
 

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

bug #21836: gamma_inc_P and gamma_inc_Q only satisfy P+Q=1 within errors

Submitter:  -Deleted Account- <bjg>
Submitted:  Tue 18 Dec 2007 06:50:20 PM UTC
   
 
Category:  Accuracy problem Severity:  2 - Minor
Operating System:  Status:  Confirmed
Assigned to:  None Open/Closed:  Open
Release:  1.10

Tue 18 Dec 2007 06:50:20 PM UTC, original submission:  

BUG #44 -- gamma_inc_P and gamma_inc_Q only satisfy P+Q=1 within errors

The sum of gamma_inc_P and gamma_inc_Q doesn't always satisfy the
identity P+Q=1 exactly (although it is correct within errors), due the
slightly different branch conditions for the series and continued
fraction expansions.  These could be made identical so that P+Q=1 exactly.

#include <stdio.h>
#include <gsl/gsl_sf_gamma.h>

int
main (void)
{
  gsl_sf_result r1, r2;
  double a = 0.3, x = 1.0;
  gsl_sf_gamma_inc_P_e (a, x, &r1);
  gsl_sf_gamma_inc_Q_e (a, x, &r2);
  printf("%.18e\n", r1.val);
  printf("%.18e\n", r2.val);
  printf("%.18e\n", r1.val + r2.val);
}

$ ./a.out
9.156741562411074842e-01
8.432584375889111417e-02
9.999999999999985567e-01


-Deleted Account- <bjg>

 

(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

 

CC list is empty

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2008-02-10 bjg Severity3 - Normal 2 - Minor
    StatusNone Confirmed

Back to the top

Powered by Savane 3.13-d3ae.
Corresponding source code