diff --git a/lib/node_modules/@stdlib/stats/base/dists/uniform/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/uniform/logcdf/README.md index d2fc53a00424..7586f2e3f76b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/uniform/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/uniform/logcdf/README.md @@ -147,6 +147,100 @@ for ( i = 0; i < 25; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/uniform/logcdf.h" +``` + +#### stdlib_base_dists_uniform_logcdf( x, a, b ) + +Evaluates the logarithm of the [cumulative distribution function][cdf] of a [uniform][uniform-distribution] distribution with parameters `a` (minimum support) and `b` (maximum support). + +```c +double out = stdlib_base_dists_uniform_logcdf( 9.0, 0.0, 10.0 ); +// returns ~-0.105 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **a**: `[in] double` minimum support. +- **b**: `[in] double` maximum support. + +```c +double stdlib_base_dists_uniform_logcdf( const double x, const double a, const double b ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/uniform/logcdf.h" +#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 a; + double b; + double x; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = random_uniform( -10.0, 10.0 ); + a = random_uniform( -20.0, 0.0 ); + b = random_uniform( a, a+40.0 ); + y = stdlib_base_dists_uniform_logcdf( x, a, b ); + printf( "x: %lf, a: %lf, b: %lf, ln(F(x;a,b)): %lf\n", x, a, b, y ); + } +} +``` + +
+ + +