diff --git a/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/benchmark.js index 5d1dbf05f2f1..80a5da664d26 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var pkg = require( './../package.json' ).name; var isfinitef = require( './../lib' ); @@ -30,14 +30,19 @@ var isfinitef = require( './../lib' ); // MAIN // bench( pkg, function benchmark( b ) { + var opts; var x; var y; var i; + opts = { + 'dtype': 'float32' + }; + x = uniform( 100, -5.0e6, 5.0e6, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = isfinitef( x ); + y = isfinitef( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/benchmark.native.js index 2d51714b53dd..8b6df6e74c93 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -39,14 +39,19 @@ var opts = { // MAIN // bench( pkg+'::native', opts, function benchmark( b ) { + var opts; var x; var y; var i; + opts = { + 'dtype': 'float32' + }; + x = uniform( 100, -5.0e6, 5.0e6, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = isfinitef( x ); + y = isfinitef( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/c/benchmark.c index fb97f52d1031..ceb58740aebc 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/c/benchmark.c @@ -90,15 +90,18 @@ static float rand_float( void ) { */ static double benchmark( void ) { double elapsed; + float x[ 100 ]; double t; - float x; int y; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 1.0e7f*rand_float() ) - 5.0e6f; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1.0e7f*rand_float() ) - 5.0e6f; - y = isfinite( x ); + y = isfinite( x[ i%100 ] ); if ( y != 0 && y != 1 ) { printf( "should return 0 or 1\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/c/native/benchmark.c index a48acb64de85..2b6b70e6e015 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-finitef/benchmark/c/native/benchmark.c @@ -92,15 +92,18 @@ static float rand_float( void ) { */ static double benchmark( void ) { double elapsed; + float x[ 100 ]; double t; - float x; bool b; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_float()*1.0e7f ) - 5.0e6f; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = (rand_float()*1.0e7f) - 5.0e6f; - b = stdlib_base_is_finitef( x ); + b = stdlib_base_is_finitef( x[ i%100 ] ); if ( b != true && b != false ) { printf( "should return either true or false\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-finitef/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-finitef/test/test.js index 14f10ae00b53..55f0afeeca35 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finitef/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-finitef/test/test.js @@ -48,26 +48,26 @@ tape( 'the function returns `true` if provided a finite number', function test( ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isfinitef( values[i] ), true, 'returns true when provided '+values[i] ); + t.equal( isfinitef( values[i] ), true, 'returns expected value when provided '+values[i] ); } for ( i = -100; i < 101; i++ ) { - t.equal( isfinitef( i ), true, 'returns true when provided '+i ); + t.equal( isfinitef( i ), true, 'returns expected value when provided '+i ); } t.end(); }); tape( 'the function returns `false` if provided `+infinity`', function test( t ) { - t.equal( isfinitef( PINF ), false, 'returns false' ); + t.equal( isfinitef( PINF ), false, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `-infinity`', function test( t ) { - t.equal( isfinitef( NINF ), false, 'returns false' ); + t.equal( isfinitef( NINF ), false, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `NaN`', function test( t ) { - t.equal( isfinitef( NaN ), false, 'returns false' ); - t.equal( isfinitef( 0/0 ), false, 'returns false' ); + t.equal( isfinitef( NaN ), false, 'returns expected value' ); + t.equal( isfinitef( 0/0 ), false, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-finitef/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-finitef/test/test.native.js index 691c1973b714..db03d66702b8 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-finitef/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-finitef/test/test.native.js @@ -57,20 +57,20 @@ tape( 'the function returns `true` if provided a finite number', opts, function ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isfinitef( values[i] ), true, 'returns true when provided '+values[i] ); + t.equal( isfinitef( values[i] ), true, 'returns expected value when provided '+values[i] ); } for ( i = -100; i < 101; i++ ) { - t.equal( isfinitef( i ), true, 'returns true when provided '+i ); + t.equal( isfinitef( i ), true, 'returns expected value when provided '+i ); } t.end(); }); tape( 'the function returns `false` if provided `+infinity`', opts, function test( t ) { - t.equal( isfinitef( PINF ), false, 'returns false' ); + t.equal( isfinitef( PINF ), false, 'returns expected value' ); t.end(); }); tape( 'the function returns `false` if provided `-infinity`', opts, function test( t ) { - t.equal( isfinitef( NINF ), false, 'returns false' ); + t.equal( isfinitef( NINF ), false, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/benchmark.js index 7118cad09a6e..6be82289842c 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var pkg = require( './../package.json' ).name; var isInfinite = require( './../lib' ); @@ -30,14 +30,19 @@ var isInfinite = require( './../lib' ); // MAIN // bench( pkg, function benchmark( b ) { + var opts; var x; var y; var i; + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, -5.0e6, 5.0e6, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = isInfinite( x ); + y = isInfinite( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/benchmark.native.js index 6d07f949b744..863b4b3c960a 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -39,14 +39,19 @@ var opts = { // MAIN // bench( pkg+'::native', opts, function benchmark( b ) { + var opts; var x; var y; var i; + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, -5.0e6, 5.0e6, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = isInfinite( x ); + y = isInfinite( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/c/benchmark.c index bfdafbe8df21..e0d736e17c3c 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/c/benchmark.c @@ -90,15 +90,18 @@ static double rand_double( void ) { */ static double benchmark( void ) { double elapsed; - double x; + double x[ 100 ]; double t; int y; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 1.0e7*rand_double() ) - 5.0e6; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1.0e7*rand_double() ) - 5.0e6; - y = isinf( x ); + y = isinf( x[ i%100 ] ); if ( y != 0 && y != 1 ) { printf( "should return 0 or 1\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/c/native/benchmark.c index 468d1cd9863d..4d031ec75f81 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinite/benchmark/c/native/benchmark.c @@ -92,15 +92,18 @@ static double rand_double( void ) { */ static double benchmark( void ) { double elapsed; - double x; + double x[ 100 ]; double t; bool b; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = (rand_double()*1.0e7) - 5.0e6; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = (rand_double()*1.0e7) - 5.0e6; - b = stdlib_base_is_infinite( x ); + b = stdlib_base_is_infinite( x[ i%100 ] ); if ( b != true && b != false ) { printf( "should return either true or false\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinite/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-infinite/test/test.js index 60033968c3cc..7975c74ccc03 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinite/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinite/test/test.js @@ -35,12 +35,12 @@ tape( 'main export is a function', function test( t ) { }); tape( 'the function returns `true` if provided `+infinity`', function test( t ) { - t.equal( isInfinite( PINF ), true, 'returns true' ); + t.equal( isInfinite( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `true` if provided `-infinity`', function test( t ) { - t.equal( isInfinite( NINF ), true, 'returns true' ); + t.equal( isInfinite( NINF ), true, 'returns expected value' ); t.end(); }); @@ -63,7 +63,7 @@ tape( 'the function returns `false` if not provided an infinite number', functio ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isInfinite( values[i] ), false, 'returns false' ); + t.equal( isInfinite( values[i] ), false, 'returns expected value' ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinite/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-infinite/test/test.native.js index c0d93b21e957..10584eb964c9 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinite/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinite/test/test.native.js @@ -44,12 +44,12 @@ tape( 'main export is a function', opts, function test( t ) { }); tape( 'the function returns `true` if provided `+infinity`', opts, function test( t ) { - t.equal( isInfinite( PINF ), true, 'returns true' ); + t.equal( isInfinite( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `true` if provided `-infinity`', opts, function test( t ) { - t.equal( isInfinite( NINF ), true, 'returns true' ); + t.equal( isInfinite( NINF ), true, 'returns expected value' ); t.end(); }); @@ -72,7 +72,7 @@ tape( 'the function returns `false` if not provided an infinite number', opts, f ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isInfinite( values[i] ), false, 'returns false' ); + t.equal( isInfinite( values[i] ), false, 'returns expected value' ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/benchmark.js index d256336cfc51..306f7b13b39c 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var pkg = require( './../package.json' ).name; var isInfinitef = require( './../lib' ); @@ -30,14 +30,19 @@ var isInfinitef = require( './../lib' ); // MAIN // bench( pkg, function benchmark( b ) { + var opts; var x; var y; var i; + opts = { + 'dtype': 'float32' + }; + x = uniform( 100, -5.0e6, 5.0e6, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = isInfinitef( x ); + y = isInfinitef( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/benchmark.native.js index ae0a66b2548f..fcdbaa1d72e3 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,10 +43,14 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + opts = { + 'dtype': 'float32' + }; + x = uniform( 100, -5.0e6, 5.0e6, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = isInfinitef( x ); + y = isInfinitef( x[ i%x.length ] ); if ( typeof y !== 'boolean' ) { b.fail( 'should return a boolean' ); } diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/c/benchmark.c index 90957078f09b..c57aa095de7d 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/c/benchmark.c @@ -90,15 +90,18 @@ static float rand_float( void ) { */ static double benchmark( void ) { double elapsed; + float x[ 100 ]; double t; - float x; int y; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 1.0e7f*rand_float() ) - 5.0e6f; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1.0e7f*rand_float() ) - 5.0e6f; - y = isinf( x ); + y = isinf( x[ i%100 ] ); if ( y != 0 && y != 1 ) { printf( "should return 0 or 1\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/c/native/benchmark.c index 8949069919ca..1adaf0ad1020 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/benchmark/c/native/benchmark.c @@ -92,15 +92,18 @@ static float rand_float( void ) { */ static double benchmark( void ) { double elapsed; + float x[ 100 ]; double t; - float x; bool b; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_float()*1.0e7f ) - 5.0e6f; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = (rand_float()*1.0e7f) - 5.0e6f; - b = stdlib_base_is_infinitef( x ); + b = stdlib_base_is_infinitef( x[ i%100 ] ); if ( b != true && b != false ) { printf( "should return either true or false\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/test/test.js b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/test/test.js index 25b713e79850..69648577234e 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/test/test.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/test/test.js @@ -35,12 +35,12 @@ tape( 'main export is a function', function test( t ) { }); tape( 'the function returns `true` if provided `+infinity`', function test( t ) { - t.equal( isInfinitef( PINF ), true, 'returns true' ); + t.equal( isInfinitef( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `true` if provided `-infinity`', function test( t ) { - t.equal( isInfinitef( NINF ), true, 'returns true' ); + t.equal( isInfinitef( NINF ), true, 'returns expected value' ); t.end(); }); @@ -63,7 +63,7 @@ tape( 'the function returns `false` if not provided an infinite number', functio ]; for ( i = 0; i < values.length; i++ ) { - t.equal( isInfinitef( values[i] ), false, 'returns false' ); + t.equal( isInfinitef( values[i] ), false, 'returns expected value' ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/test/test.native.js b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/test/test.native.js index 10956148a015..b9241f66415e 100644 --- a/lib/node_modules/@stdlib/math/base/assert/is-infinitef/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/assert/is-infinitef/test/test.native.js @@ -44,11 +44,11 @@ tape( 'main export is a function', opts, function test( t ) { }); tape( 'the function returns `true` if provided `+infinity`', opts, function test( t ) { - t.equal( isInfinitef( PINF ), true, 'returns true' ); + t.equal( isInfinitef( PINF ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `true` if provided `-infinity`', opts, function test( t ) { - t.equal( isInfinitef( NINF ), true, 'returns true' ); + t.equal( isInfinitef( NINF ), true, 'returns expected value' ); t.end(); });