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 @@ -137,10 +137,6 @@ for ( i = 0; i < 10; i++ ) {

<!-- /.examples -->

<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="references">

<!-- C interface documentation. -->

* * *
Expand Down Expand Up @@ -231,6 +227,12 @@ int main( void ) {

</section>

<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="references">

</section>

<!-- /.references -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
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 @@ -51,8 +51,8 @@ bench( pkg+'::native', opts, function benchmark( b ) {
x = new Float64Array( len );
lambda = new Float64Array( len );
for ( i = 0; i < len; i++ ) {
x[ i ] = ( randu()*100.0 );
lambda[ i ] = ( randu()*100.0 ) + EPS;
x[ i ] = uniform( 0.0, 100.0 );
lambda[ i ] = uniform( EPS, 100.0 );
}

b.tic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static double benchmark( void ) {

t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
y = stdlib_base_dists_exponential_logpdf( x[ i % 100 ], lambda[ i % 100 ]);
y = stdlib_base_dists_exponential_logpdf( x[ i % 100 ], lambda[ 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 @@ -42,7 +42,7 @@ double stdlib_base_dists_exponential_logpdf( const double x, const double lambda
) {
return 0.0/0.0; // NaN
}
if( x < 0.0){
if ( x < 0.0 ) {
return STDLIB_CONSTANT_FLOAT64_NINF;
}
return ( -x*lambda ) + stdlib_base_ln( lambda );
Expand Down
Loading