diff --git a/lib/node_modules/@stdlib/math/base/special/fast/abs/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/fast/abs/benchmark/benchmark.js index 34f20ed0f137..d0e812f7d576 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/abs/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/abs/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var abs = require( './../lib' ); @@ -34,10 +34,13 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -5000.0, 5000.0, { + 'dtype': 'float64' + }); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*10000.0 ) - 5000.0; - y = abs( x ); + y = abs( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/fast/abs/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/fast/abs/benchmark/benchmark.native.js index 31eeae0c7bb6..920f2d2e756e 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/abs/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/abs/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,10 +43,13 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, -5000.0, 5000.0, { + 'dtype': 'float64' + }); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 10000.0 ) - 5000.0; - y = abs( x ); + y = abs( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/fast/abs/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/fast/abs/benchmark/c/native/benchmark.c index 93b5e00851c5..00d2cc73f0e0 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/abs/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/fast/abs/benchmark/c/native/benchmark.c @@ -91,15 +91,18 @@ static double rand_double( void ) { */ static double benchmark( void ) { double elapsed; - double x; + double x[ 100 ]; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 10000.0 * rand_double() ) - 5000.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 10000.0 * rand_double() ) - 5000.0; - y = stdlib_base_fast_abs( x ); + y = stdlib_base_fast_abs( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/fast/abs/test/test.js b/lib/node_modules/@stdlib/math/base/special/fast/abs/test/test.js index 3c9c26ac2e33..f6df75cb8059 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/abs/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/abs/test/test.js @@ -38,26 +38,26 @@ tape( 'main export is a function', function test( t ) { }); tape( 'the function computes the absolute value of a number', function test( t ) { - t.strictEqual( abs( -2.0 ), 2.0, 'negative number' ); - t.strictEqual( abs( 3.0 ), 3.0, 'positive number' ); - t.strictEqual( abs( 0.0 ), 0.0, 'zero' ); - t.strictEqual( abs( -PI ), PI, 'pi' ); + t.strictEqual( abs( -2.0 ), 2.0, 'returns expected value' ); + t.strictEqual( abs( 3.0 ), 3.0, 'returns expected value' ); + t.strictEqual( abs( 0.0 ), 0.0, 'returns expected value' ); + t.strictEqual( abs( -PI ), PI, 'returns expected value' ); t.end(); }); tape( 'the function returns `-0` if provided `-0` (not IEEE 754 compliant)', function test( t ) { - t.strictEqual( isNegativeZero( abs( -0.0 ) ), true, 'returns negative zero' ); + t.strictEqual( isNegativeZero( abs( -0.0 ) ), true, 'returns expected value' ); t.end(); }); tape( 'the function computes the absolute value of `infinity`', function test( t ) { - t.strictEqual( abs( PINF ), PINF, 'returns +infinity' ); - t.strictEqual( abs( NINF ), PINF, 'returns +infinity' ); + t.strictEqual( abs( PINF ), PINF, 'returns expected value' ); + t.strictEqual( abs( NINF ), PINF, 'returns expected value' ); t.end(); }); tape( 'if provided `NaN`, the function returns `NaN`', function test( t ) { var v = abs( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/fast/abs/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/fast/abs/test/test.native.js index b8a795b50078..3cd034b399fc 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/abs/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/abs/test/test.native.js @@ -47,26 +47,26 @@ tape( 'main export is a function', opts, function test( t ) { }); tape( 'the function computes the absolute value of a number', opts, function test( t ) { - t.strictEqual( abs( -2.0 ), 2.0, 'negative number' ); - t.strictEqual( abs( 3.0 ), 3.0, 'positive number' ); - t.strictEqual( abs( 0.0 ), 0.0, 'zero' ); - t.strictEqual( abs( -PI ), PI, 'pi' ); + t.strictEqual( abs( -2.0 ), 2.0, 'returns expected value' ); + t.strictEqual( abs( 3.0 ), 3.0, 'returns expected value' ); + t.strictEqual( abs( 0.0 ), 0.0, 'returns expected value' ); + t.strictEqual( abs( -PI ), PI, 'returns expected value' ); t.end(); }); tape( 'the function returns `-0` if provided `-0` (not IEEE 754 compliant)', opts, function test( t ) { - t.strictEqual( isNegativeZero( abs( -0.0 ) ), true, 'returns negative zero' ); + t.strictEqual( isNegativeZero( abs( -0.0 ) ), true, 'returns expected value' ); t.end(); }); tape( 'the function computes the absolute value of `infinity`', opts, function test( t ) { - t.strictEqual( abs( PINF ), PINF, 'returns +infinity' ); - t.strictEqual( abs( NINF ), PINF, 'returns +infinity' ); + t.strictEqual( abs( PINF ), PINF, 'returns expected value' ); + t.strictEqual( abs( NINF ), PINF, 'returns expected value' ); t.end(); }); tape( 'if provided `NaN`, the function returns `NaN`', opts, function test( t ) { var v = abs( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/fast/acosh/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/fast/acosh/benchmark/benchmark.js index fc1a983d6d65..8c04b9e32556 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/acosh/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/acosh/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var acosh = require( './../lib' ); @@ -34,10 +34,13 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, 1.0, 100.0, { + 'dtype': 'float64' + }); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = 1.0 + ( randu()*100.0 ); - y = acosh( x ); + y = acosh( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/fast/acosh/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/fast/acosh/benchmark/benchmark.native.js index 6f768eb2e254..fe006a6b32ee 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/acosh/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/acosh/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,10 +43,13 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, 1.0, 100.0, { + 'dtype': 'float64' + }); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = 1.0 + ( randu()*100.0 ); - y = acosh( x ); + y = acosh( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/fast/acosh/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/fast/acosh/benchmark/c/native/benchmark.c index 2cb78a9281d7..2d71a0c6a687 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/acosh/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/fast/acosh/benchmark/c/native/benchmark.c @@ -91,15 +91,18 @@ static double rand_double( void ) { */ static double benchmark( void ) { double elapsed; - double x; + double x[ 100 ]; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 100.0 * rand_double() ) + 1.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 100.0 * rand_double() ) + 1.0; - y = stdlib_base_fast_acosh( x ); + y = stdlib_base_fast_acosh( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/fast/acosh/test/test.js b/lib/node_modules/@stdlib/math/base/special/fast/acosh/test/test.js index 8b909b2816bc..34e3759fe43a 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/acosh/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/acosh/test/test.js @@ -142,7 +142,7 @@ tape( 'the function computes the hyperbolic arccosine for huge values', function tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var v = acosh( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -152,7 +152,7 @@ tape( 'the function returns `NaN` if provided value less than `1`', function tes for ( i = 0; i < 1e3; i++ ) { v = -(randu()*1.0e6) + (1.0-EPS); - t.strictEqual( isnan( acosh( v ) ), true, 'returns NaN when provided '+v ); + t.strictEqual( isnan( acosh( v ) ), true, 'returns expected value when provided '+v ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/fast/acosh/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/fast/acosh/test/test.native.js index 76ba4827205f..c60fe036eb12 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/acosh/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/acosh/test/test.native.js @@ -151,7 +151,7 @@ tape( 'the function computes the hyperbolic arccosine for huge values', opts, fu tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t ) { var v = acosh( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -161,7 +161,7 @@ tape( 'the function returns `NaN` if provided value less than `1`', opts, functi for ( i = 0; i < 1e3; i++ ) { v = -(randu()*1.0e6) + (1.0-EPS); - t.strictEqual( isnan( acosh( v ) ), true, 'returns NaN when provided '+v ); + t.strictEqual( isnan( acosh( v ) ), true, 'returns expected value when provided '+v ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/fast/asinh/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/fast/asinh/benchmark/benchmark.js index 5391821ed7bb..8d3306427e96 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/asinh/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/asinh/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var asinh = require( './../lib' ); @@ -34,10 +34,13 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -100.0, 100.0, { + 'dtype': 'float64' + }); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*200.0 ) - 100.0; - y = asinh( x ); + y = asinh( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/fast/asinh/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/fast/asinh/benchmark/benchmark.native.js index 32fe7ca1bb2d..ca9f360a5d88 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/asinh/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/asinh/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,10 +43,13 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, -100.0, 100.0, { + 'dtype': 'float64' + }); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*200.0 ) - 100.0; - y = asinh( x ); + y = asinh( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/fast/asinh/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/fast/asinh/benchmark/c/native/benchmark.c index 286e02912cf7..fe877d209a92 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/asinh/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/fast/asinh/benchmark/c/native/benchmark.c @@ -91,15 +91,18 @@ static double rand_double( void ) { */ static double benchmark( void ) { double elapsed; - double x; + double x[ 100 ]; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_double() * 200.0 ) - 100.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( rand_double() * 200.0 ) - 100.0; - y = stdlib_base_fast_asinh( x ); + y = stdlib_base_fast_asinh( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/fast/asinh/test/test.js b/lib/node_modules/@stdlib/math/base/special/fast/asinh/test/test.js index a00890365690..c2b19d42885c 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/asinh/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/asinh/test/test.js @@ -55,7 +55,7 @@ tape( 'main export is a function', function test( t ) { tape( 'the function underflows if provided a number which is negligible compared to unity', function test( t ) { var x = EPS / 2.0; var v = asinh( x ); - t.strictEqual( v, 0.0, 'returns 0' ); + t.strictEqual( v, 0.0, 'returns expected value' ); t.end(); }); @@ -278,36 +278,36 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[-100.0,-28 tape( 'the function overflows if provided a value which, when squared, overflows', function test( t ) { var x = 1.0e200; var v = asinh( x ); - t.strictEqual( v, PINF, 'returns +infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var v = asinh( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `+infinity` if provided `+infinity`', function test( t ) { var v = asinh( PINF ); - t.strictEqual( v, PINF, 'returns +infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `-infinity` if provided `-infinity`', function test( t ) { var v = asinh( NINF ); - t.strictEqual( v, NINF, 'returns -infinity' ); + t.strictEqual( v, NINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `-0` if provided `-0`', function test( t ) { var v = asinh( -0 ); - t.strictEqual( isNegativeZero( v ), true, 'returns -0' ); + t.strictEqual( isNegativeZero( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `+0` if provided `+0`', function test( t ) { var v = asinh( +0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/fast/asinh/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/fast/asinh/test/test.native.js index 52e61a11be51..5cf402a7663e 100644 --- a/lib/node_modules/@stdlib/math/base/special/fast/asinh/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/fast/asinh/test/test.native.js @@ -64,7 +64,7 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function underflows if provided a number which is negligible compared to unity', opts, function test( t ) { var x = EPS / 2.0; var v = asinh( x ); - t.strictEqual( v, 0.0, 'returns 0' ); + t.strictEqual( v, 0.0, 'returns expected value' ); t.end(); }); @@ -287,36 +287,36 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[-100.0,-28 tape( 'the function overflows if provided a value which, when squared, overflows', opts, function test( t ) { var x = 1.0e200; var v = asinh( x ); - t.strictEqual( v, PINF, 'returns +infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t ) { var v = asinh( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `+infinity` if provided `+infinity`', opts, function test( t ) { var v = asinh( PINF ); - t.strictEqual( v, PINF, 'returns +infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `-infinity` if provided `-infinity`', opts, function test( t ) { var v = asinh( NINF ); - t.strictEqual( v, NINF, 'returns -infinity' ); + t.strictEqual( v, NINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `-0` if provided `-0`', opts, function test( t ) { var v = asinh( -0 ); - t.strictEqual( isNegativeZero( v ), true, 'returns -0' ); + t.strictEqual( isNegativeZero( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `+0` if provided `+0`', opts, function test( t ) { var v = asinh( +0 ); - t.strictEqual( isPositiveZero( v ), true, 'returns +0' ); + t.strictEqual( isPositiveZero( v ), true, 'returns expected value' ); t.end(); });