Skip to content

Commit 5539f34

Browse files
authored
fix: update benchmark.js
Signed-off-by: Shabareesh Shetty <139731143+ShabiShett07@users.noreply.github.com>
1 parent dffa637 commit 5539f34

File tree

1 file changed

+9
-3
lines changed
  • lib/node_modules/@stdlib/math/base/special/bessely1/benchmark

1 file changed

+9
-3
lines changed

lib/node_modules/@stdlib/math/base/special/bessely1/benchmark/benchmark.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
24+
var Float64Array = require( '@stdlib/array/float64' );
25+
var uniform = require( '@stdlib/random/base/uniform' );
2526
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2627
var pkg = require( './../package.json' ).name;
2728
var y1 = require( './../lib' );
@@ -30,14 +31,19 @@ var y1 = require( './../lib' );
3031
// MAIN //
3132

3233
bench( pkg, function benchmark( b ) {
34+
var len;
3335
var x;
3436
var y;
3537
var i;
3638

39+
len = 100;
40+
x = new Float64Array( len );
41+
for ( i = 0; i < len; i++ ) {
42+
x[ i ] = uniform( 0.0, 100000.0 );
43+
}
3744
b.tic();
3845
for ( i = 0; i < b.iterations; i++ ) {
39-
x = ( randu()*100000.0 ) - 0.0;
40-
y = y1( x );
46+
y = y1( x[ i % len ] );
4147
if ( isnan( y ) ) {
4248
b.fail( 'should not return NaN' );
4349
}

0 commit comments

Comments
 (0)