Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ for ( i = 0; i < 10; i++ ) {
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
double out = stdlib_base_dists_cauchy_cdf( 4.0, 0.0, 2.0 );
// returns ~0.852
```

The function accepts the following arguments:
Expand Down Expand Up @@ -214,9 +214,9 @@ static double random_uniform( const double min, const double max ) {

int main( void ) {
double gamma;
double x;
double x0;
double y;
double x;
int i;

for ( i = 0; i < 25; i++ ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ var pkg = require( './../package.json' ).name;

// VARIABLES //

var logcdf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
var cdf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
var opts = {
'skip': ( logcdf instanceof Error )
'skip': ( cdf instanceof Error )
};


Expand All @@ -60,7 +60,7 @@ bench( pkg+'::native', opts, function benchmark( b ) {

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
y = logcdf( x[ i % len ], x0[ i % len ], gamma[ i % len ] );
y = cdf( x[ i % len ], x0[ i % len ], gamma[ i % len ] );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ static double random_uniform( const double min, const double max ) {

int main( void ) {
double gamma;
double x;
double x0;
double y;
double x;
int i;

for ( i = 0; i < 25; i++ ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern "C" {
#endif

/**
* Evaluates the cumulative distribution function (CDF) for a Weibull distribution with shape parameter `k` and scale parameter `lambda` at a value `x`.
* Evaluates the cumulative distribution function (CDF) for a Cauchy distribution with location parameter `x0` and scale parameter `gamma` at a value `x`.
*/
double stdlib_base_dists_cauchy_cdf( const double x, const double x0, const double gamma );

Expand Down
Loading