bpmnr/nr_gammq.c

Go to the documentation of this file.
00001 
00005 #include <bpm/bpm_messages.h>
00006 #include <bpm/bpm_nr.h>
00007 
00014 double nr_gammq( double a, double x ) {
00015 
00016   double gamser, gammcf, gln;
00017   double res = -DBL_MAX;
00018 
00019   if ( x < 0.0 || a <= 0.0 ) {
00020     bpm_error( "Invalid arguments in nr_gammq(...)",
00021                __FILE__, __LINE__ );
00022     return -DBL_MAX;
00023   }
00024 
00025   if (x < (a+1.0) ) {
00026 
00027     nr_gser( &gamser, a, x, &gln );
00028     res =  1.0 - gamser;
00029       
00030   } else {
00031     nr_gcf( &gammcf, a, x, &gln );
00032     res = gammcf;
00033   }
00034 
00035   return res;
00036 }

Generated on Thu Jan 10 10:18:04 2008 for libbpm by  doxygen 1.5.1