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 @@ -44,14 +44,12 @@ var sqrt = require( '@stdlib/math/base/special/sqrt' );
* // returns ~17.941
*/
function factory( sigma ) {
var s2;
if ( isnan( sigma ) || sigma < 0.0 ) {
return constantFunction( NaN );
}
if ( sigma === 0.0 ) {
return degenerate( 0.0 );
}
s2 = sigma * sigma;
return quantile;

/**
Expand All @@ -69,7 +67,7 @@ function factory( sigma ) {
if ( isnan( p ) || p < 0.0 || p > 1.0 ) {
return NaN;
}
return sqrt( -2.0 * s2 * log1p( -p ) );
return sigma * sqrt( -2.0 * log1p( -p ) );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ var sqrt = require( '@stdlib/math/base/special/sqrt' );
* // returns NaN
*/
function quantile( p, sigma ) {
var s2;
if ( isnan( sigma ) || sigma < 0.0 ) {
return NaN;
}
Expand All @@ -74,8 +73,7 @@ function quantile( p, sigma ) {
if ( sigma === 0.0 ) {
return 0.0;
}
s2 = sigma * sigma;
return sqrt( -2.0 * s2 * log1p( -p ) );
return sigma * sqrt( -2.0 * log1p( -p ) );
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
* // returns ~1.794
*/
double stdlib_base_dists_rayleigh_quantile( const double p, const double sigma ) {
double s2;
if (
stdlib_base_is_nan( p ) ||
stdlib_base_is_nan( sigma ) ||
Expand All @@ -46,6 +45,5 @@ double stdlib_base_dists_rayleigh_quantile( const double p, const double sigma )
if ( sigma == 0.0 ) {
return 0.0;
}
s2 = sigma * sigma;
return stdlib_base_sqrt( -2.0 * s2 * stdlib_base_log1p( -p ) );
return sigma * stdlib_base_sqrt( -2.0 * stdlib_base_log1p( -p ) );
}