Skip to content
Closed
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 @@ -17,6 +17,7 @@
*/

'use strict';
const process = require('process');

// MODULES //

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Evaluates the natural logarithm of the [cumulative distribution function][cdf] (

```c
double y = stdlib_base_frechet_logcdf( 10.0, 2.0, 3.0, 2.0 );
// returns ~0.141
// returns ~-0.141
```

The function accepts the following arguments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static double benchmark( void ) {

t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
y = stdlib_base_dists_frechet_logcdf( x[i%100], alpha[ i%100 ], s[ i%100 ], m[ i%100 ] );
y = stdlib_base_dists_frechet_logcdf( x[ i%100 ], alpha[ i%100 ], s[ i%100 ], m[ i%100 ] );
if ( y != y ) {
printf( "should not return NaN\n" );
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @example
* double y = stdlib_base_dists_frechet_logcdf( 10.0, 2.0, 3.0, 2.0 );
* // returns ~0.141
* // returns ~-0.141
*/
double stdlib_base_dists_frechet_logcdf( const double x, const double alpha, const double s, const double m ) {
double z;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "stdlib/stats/base/dists/uniform/stdev.h"
#include "stdlib/math/base/assert/is_nan.h"

static const double SQRT_ONE_TWELFTH = 0.28867513459481287; // stdlib_base_sqrt( 1.0/12.0 )
/**
* Returns the standard deviation of a uniform distribution.
*
Expand All @@ -31,7 +32,6 @@
* // returns ~2.309
*/

static const double SQRT_ONE_TWELFTH = 0.28867513459481287; // stdlib_base_sqrt( 1.0/12.0 )

double stdlib_base_dists_uniform_stdev( const double a, const double b ) {
if (
Expand All @@ -41,5 +41,5 @@ double stdlib_base_dists_uniform_stdev( const double a, const double b ) {
) {
return 0.0 / 0.0; // NaN
}
return SQRT_ONE_TWELFTH * ( b-a );
return SQRT_ONE_TWELFTH * ( b-a );
}
Loading