diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/README.md index a394e32655e7..0aac4fe50b7a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/README.md @@ -139,6 +139,104 @@ for ( i = 0; i < 10; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/cauchy/cdf.h" +``` + +#### stdlib_base_dists_cauchy_cdf( x, x0, gamma ) + +Evaluates the [cumulative distribution function][cdf] (CDF) for a [Cauchy][cauchy-distribution] distribution with parameters `x0` (location parameter) and `gamma > 0` (scale parameter). + +```c +double out = stdlib_base_dists_cauchy_cdf( 0.5, 0.0, 2.0 ); +// returns ~0.333 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **x0**: `[in] double` location parameter. +- **gamma**: `[in] double` scale parameter. + +```c +double stdlib_base_dists_cauchy_cdf( const double x, const double x0, const double gamma ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/cauchy/cdf.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 gamma; + double x; + double x0; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = random_uniform( 0.0, 10.0 ); + x0 = random_uniform( 0.0, 10.0 ); + gamma = random_uniform( 0.0, 10.0 ); + y = stdlib_base_dists_cauchy_cdf( x, x0, gamma ); + printf( "x: %lf, k: %lf, γ: %lf, F(x;x0,γ): %lf\n", x, x0, gamma, y ); + } +} +``` + +
+ + + +
+ + +