Category : C Source Code
Archive   : CEPHES22.ZIP
Filename : GDTR.C

 
Output of file : GDTR.C contained in archive : CEPHES22.ZIP
/* gdtr.c
*
* Gamma distribution function
*
*
*
* SYNOPSIS:
*
* double a, b, x, y, gdtr();
*
* y = gdtr( a, b, x );
*
*
*
* DESCRIPTION:
*
* Returns the integral from zero to x of the gamma probability
* density function:
*
*
* x
* b -
* a | | b-1 -at
* y = ----- | t e dt
* - | |
* | (b) -
* 0
*
* The incomplete gamma integral is used, according to the
* relation
*
* y = igam( b, ax ).
*
*
* ACCURACY:
*
* See igam().
*
* ERROR MESSAGES:
*
* message condition value returned
* gdtr domain x < 0 0.0
*
*/
/* gdtrc.c
*
* Complemented gamma distribution function
*
*
*
* SYNOPSIS:
*
* double a, b, x, y, gdtrc();
*
* y = gdtrc( a, b, x );
*
*
*
* DESCRIPTION:
*
* Returns the integral from x to infinity of the gamma
* probability density function:
*
*
* inf.
* b -
* a | | b-1 -at
* y = ----- | t e dt
* - | |
* | (b) -
* x
*
* The incomplete gamma integral is used, according to the
* relation
*
* y = igamc( b, ax ).
*
*
* ACCURACY:
*
* See igamc().
*
* ERROR MESSAGES:
*
* message condition value returned
* gdtrc domain x < 0 0.0
*
*/

/* gdtr() */


/*
Cephes Math Library Release 2.0: April, 1987
Copyright 1984, 1987 by Stephen L. Moshier
Direct inquiries to 30 Frost Street, Cambridge, MA 02140
*/

#include "mconf.h"

double gdtr( a, b, x )
double a, b, x;
{
double igam();

if( x < 0.0 )
{
mtherr( "gdtr", DOMAIN );
return( 0.0 );
}
return( igam( b, a * x ) );
}



double gdtrc( a, b, x )
double a, b, x;
{
double igamc();

if( x < 0.0 )
{
mtherr( "gdtrc", DOMAIN );
return( 0.0 );
}
return( igamc( b, a * x ) );
}


  3 Responses to “Category : C Source Code
Archive   : CEPHES22.ZIP
Filename : GDTR.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/