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 @@ -169,8 +169,8 @@ for ( i = 0; i < 10; i++ ) {
Evaluates the [probability density function][pdf] (PDF) for a [Gumbel][gumbel-distribution] distribution with parameters `mu` (location parameter) and `beta` (scale parameter).

```c
double out = stdlib_base_dists_gumbel_pdf( 2.0, 3.0 );
// returns ~0.199
double out = stdlib_base_dists_gumbel_pdf( 0.0, 0.0, 2.0 );
// returns ~0.184
```

The function accepts the following arguments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var Float64Array = require( '@stdlib/array/float64' );
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/base/uniform' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var EPS = require( '@stdlib/constants/float64/eps' );
var tryRequire = require( '@stdlib/utils/try-require' );
Expand Down Expand Up @@ -53,9 +53,9 @@ bench( pkg+'::native', opts, function benchmark( b ) {
mu = new Float64Array( len );
x = new Float64Array( len );
for ( i = 0; i < len; i++ ) {
x[ i ] = ( randu()*100.0 ) - 100.0;
mu[ i ] = ( randu()*100.0 ) - 50.0;
beta[ i ] = ( randu()*20.0 ) + EPS;
x[ i ] = uniform( -100.0, 100.0 );
mu[ i ] = uniform( -50.0, 100.0 );
beta[ i ] = uniform( EPS, 20.0 );
}

b.tic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ double stdlib_base_dists_gumbel_pdf( const double x, const double mu, const doub
return 0.0;
}
z = ( x - mu ) / beta;
return ( 1.0 / beta ) * stdlib_base_exp( -z -stdlib_base_exp( -z ) );
return ( 1.0 / beta ) * stdlib_base_exp( -z - stdlib_base_exp( -z ) );
}