diff --git a/lib/node_modules/@stdlib/math/base/special/kernel-betainc/README.md b/lib/node_modules/@stdlib/math/base/special/kernel-betainc/README.md index 6c530e62732e..e04fce9ef8b1 100644 --- a/lib/node_modules/@stdlib/math/base/special/kernel-betainc/README.md +++ b/lib/node_modules/@stdlib/math/base/special/kernel-betainc/README.md @@ -18,7 +18,7 @@ limitations under the License. --> -# Kernel Betainc +# kernelBetainc > [Incomplete beta function][incomplete-beta-function] and its first derivative. @@ -135,6 +135,112 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/kernel_betainc.h" +``` + +#### stdlib_base_kernel_betainc( x, a, b, regularized, upper, &out, &derivative ) + +Evaluates the incomplete beta function and its first derivative. + +```c +double out; +double deriv; + +stdlib_base_kernel_betainc( 0.5, 2.0, 5.0, true, false, &out, &deriv ); +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **a**: `[in] double` input value. +- **b**: `[in] double` input value. +- **regularized**: `[in] bool` indicating if the function should evaluate the regularized incomplete beta function. +- **upper**: `[in] bool` indicating if the function should return the upper tail of the incomplete beta function. +- **out**: `[out] double*` pointer to store the function value. +- **derivative**: `[out] double*` pointer to store the first derivative. + +```c +void stdlib_base_kernel_betainc( double x, double a, double b, const bool regularized, bool upper, double *out, double *derivative ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/kernel_betainc.h" +#include "stdlib/random/base/randu.h" +#include +#include +#include + +int main( void ) { + + double out; + double deriv; + double x; + double a; + double b; + int32_t i; + struct BasePRNGObject *obj = stdlib_base_random_randu_allocate( 0 ); + + for ( i = 0; i < 100; i++ ) { + x = stdlib_base_random_randu( obj ); + a = stdlib_base_random_randu( obj ) * 10.0; + b = stdlib_base_random_randu( obj ) * 10.0; + stdlib_base_kernel_betainc( x, a, b, true, false, &out, &deriv ); + printf( "x: %lf, \t a: %lf, \t b: %lf, \t f(x,a,b): %lf, \t f^1(x,a,b): %lf", x, a, b, out, deriv ); + } + + stdlib_base_random_randu_free( obj ); +} +``` + +
+ + + +
+ + +