Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -171,7 +171,7 @@ Evaluates the [cumulative distribution function][cdf] (CDF) for a [Cauchy][cauch

```c
double out = stdlib_base_dists_cauchy_cdf( 0.5, 0.0, 2.0 );
// returns ~0.333
// returns ~0.578
```

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

int main( void ) {
//correct order based on the length
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments here and elsewhere in this PR need to be removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//correct order based on the length

double gamma;
double x;
double x0;
double x;
double y;
int i;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
var pkg = require( './../package.json' ).name;


// VARIABLES //

Check failure on line 33 in lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/benchmark/benchmark.native.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Header comment must be followed by an empty line

var logcdf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
//corected variable name

Check failure on line 34 in lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/benchmark/benchmark.native.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Expected space or tab after '//' in comment

Check failure on line 34 in lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/benchmark/benchmark.native.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Missing empty line before comment

Check warning on line 34 in lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/benchmark/benchmark.native.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Comments should begin with an uppercase character

Check warning on line 34 in lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/benchmark/benchmark.native.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "corected"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//corected variable name

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


Expand All @@ -60,7 +60,7 @@

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
y = logcdf( x[ i % len ], x0[ i % len ], gamma[ i % len ] );

Check failure on line 63 in lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/benchmark/benchmark.native.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

'logcdf' is not defined
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ static double random_uniform( const double min, const double max ) {
}

int main( void ) {
double gamma;
//corrected order
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//corrected order

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChaitraTM This order is not correct. The order should be in order of decreasing length, not increasing length.

int i;
double x;
double x0;
double y;
int i;
double x0;
double gamma;


for ( i = 0; i < 25; i++ ) {
x = random_uniform( 0.0, 10.0 );
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