diff --git a/lib/node_modules/@stdlib/math/base/special/gammainc/README.md b/lib/node_modules/@stdlib/math/base/special/gammainc/README.md index 42fa8cba2e7d..e743844dd825 100644 --- a/lib/node_modules/@stdlib/math/base/special/gammainc/README.md +++ b/lib/node_modules/@stdlib/math/base/special/gammainc/README.md @@ -174,6 +174,98 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/gammainc.h" +``` + +#### stdlib_base_gammainc( x, s, regularized, upper ) + +Computes the regularized lower [incomplete gamma function][incomplete-gamma-function] for inputs `x` and `s`. . + +```c +double out = stdlib_base_gammainc( 1.0, 2.0, true, true ); +// returns ~0.7358 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **s**: `[in] double` input value. +- **regularized**: `[in] bool` indicating if the function should evaluate the regularized or non-regularized incomplete gamma functions. +- **upper**: `[in] bool` indicating if the function should return the upper tail of the incomplete gamma function + +```c +double stdlib_base_gammainc( double x, double a, bool regularized, bool upper ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/gammainc.h" +#include +#include + +int main( void ) { + const double x[] = { 6.0, 1.0, 7.0, 7.0, 0.0/0.0, 6.0 }; + const double a[] = { 2.0, 2.0, 5.0, 5.0, 2.0, 0.0/0.0 }; + const bool regularized[] = { true, true, true, false, true, true }; + const bool upper[] = { false, true, false, false, false, false }; + + double y; + int i; + for ( i = 0; i <6; i++ ) { + y = stdlib_base_gammainc( x[ i ], a[ i ], regularized[ i ], upper[ i ] ); + printf( "gammainc( %lf, %lf, %s, %s ) = %lf\n", x[ i ], a[ i ], regularized[ i ] ? "true" : "false", upper[ i ] ? "true" : "false", y ); + } +} +``` + +
+ + + +
+ + +