diff --git a/lib/node_modules/@stdlib/math/base/special/betaincinv/README.md b/lib/node_modules/@stdlib/math/base/special/betaincinv/README.md index f30a71e53471..f72068f56078 100644 --- a/lib/node_modules/@stdlib/math/base/special/betaincinv/README.md +++ b/lib/node_modules/@stdlib/math/base/special/betaincinv/README.md @@ -129,6 +129,112 @@ logEachMap( 'p: %0.4f, \t a: %0.4f, \t b: %0.4f, \t f(p,a,b): %0.4f', p, a, b, b + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/betaincinv.h" +``` + +#### stdlib_base_betaincinv( p, a, b, upper ) + +Inverts the regularized incomplete beta function. + +```c +double y = stdlib_base_betaincinv( 0.2, 3.0, 3.0, false ); +// returns ~0.327 + +y = stdlib_base_betaincinv( 0.4, 3.0, 3.0, false ); +// returns ~0.446 + +y = stdlib_base_betaincinv( 0.4, 3.0, 3.0, true ); +// returns ~0.554 +``` + +The function accepts the following arguments: + +- **p**: `[in] double` input probability. +- **a**: `[in] double` first shape parameter. +- **b**: `[in] double` second shape parameter. +- **upper**: `[in] bool` boolean indicating if the function should invert the upper tail of the incomplete beta function. + +```c +double stdlib_base_betaincinv( const double p, const double a, const double b, const bool upper ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/betaincinv.h" +#include +#include +#include + +static double random_uniform( const double min, const double max ) { + double v = (double)rand() / ( (double)RAND_MAX + 1.0 ); + return min + ( v*(max-min) ); +} + +int main( void ) { + double p; + double a; + double b; + double y; + int i; + + for ( i = 0; i < 100; i++ ) { + p = random_uniform( 0.0, 1.0 ); + a = random_uniform( 0.0, 10.0 ); + b = random_uniform( 0.0, 10.0 ); + y = stdlib_base_betaincinv( p, a, b, false ); + printf( "p: %lf, a: %lf, b: %lf, y: %lf\n", p, a, b, y ); + } +} +``` + +
+ + + +
+ + +