diff --git a/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/benchmark.js index e2a9b4ff0299..c68aa550c251 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/acovercos/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 acovercos = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -2.0, 0.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( -2.0*randu() ) + 0.0; - y = acovercos( x ); + y = acovercos( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/benchmark.native.js index 92d472a7e9c4..0c1994ee9d2a 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/acovercos/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,11 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, -2.0, 0.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( -2.0*randu() ) + 0.0; - y = acovercos( x ); + y = acovercos( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/c/benchmark.c index e5d6cef788c1..280d3c14a9c9 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/c/benchmark.c @@ -89,16 +89,19 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( -2.0*rand_double() ) + 0.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( -2.0*rand_double() ) + 0.0; - y = asin( 1.0 + x ); + y = asin( 1.0 + x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/c/native/benchmark.c index 0bcaeadc6beb..3d471a1b5b92 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/acovercos/benchmark/c/native/benchmark.c @@ -90,16 +90,19 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( -2.0*rand_double() ); + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( -2.0*rand_double() ); - y = stdlib_base_acovercos( x ); + y = stdlib_base_acovercos( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/acovercos/test/test.js b/lib/node_modules/@stdlib/math/base/special/acovercos/test/test.js index 3a1d127f909c..2e436c85b092 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercos/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/acovercos/test/test.js @@ -92,7 +92,7 @@ tape( 'the function computes the inverse coversed cosine (small negative numbers tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var v = acovercos( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -101,7 +101,7 @@ tape( 'the function returns `NaN` if provided a value less than `-2`', function var i; for ( i = 0; i < 1e4; i++ ) { v = -(randu()*1.0e6) - (2.0+EPS); - t.strictEqual( isnan( acovercos( v ) ), true, 'returns NaN when provided '+v ); + t.strictEqual( isnan( acovercos( v ) ), true, 'returns expected value when provided '+v ); } t.end(); }); @@ -111,7 +111,7 @@ tape( 'the function returns `NaN` if provided a value greater than `0`', functio var i; for ( i = 0; i < 1e4; i++ ) { v = (randu()*1.0e6) + 0.0 + EPS; - t.strictEqual( isnan( acovercos( v ) ), true, 'returns NaN when provided '+v ); + t.strictEqual( isnan( acovercos( v ) ), true, 'returns expected value when provided '+v ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/acovercos/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/acovercos/test/test.native.js index 5865cf8202a7..98726dbec7f4 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercos/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/acovercos/test/test.native.js @@ -101,7 +101,7 @@ tape( 'the function computes the inverse coversed cosine (small negative numbers tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t ) { var v = acovercos( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -110,7 +110,7 @@ tape( 'the function returns `NaN` if provided a value less than `-2`', opts, fun var i; for ( i = 0; i < 1e4; i++ ) { v = -(randu()*1.0e6) - (2.0+EPS); - t.strictEqual( isnan( acovercos( v ) ), true, 'returns NaN when provided '+v ); + t.strictEqual( isnan( acovercos( v ) ), true, 'returns expected value when provided '+v ); } t.end(); }); @@ -120,7 +120,7 @@ tape( 'the function returns `NaN` if provided a value greater than `0`', opts, f var i; for ( i = 0; i < 1e4; i++ ) { v = (randu()*1.0e6) + 0.0 + EPS; - t.strictEqual( isnan( acovercos( v ) ), true, 'returns NaN when provided '+v ); + t.strictEqual( isnan( acovercos( v ) ), true, 'returns expected value when provided '+v ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/acovercosf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/acovercosf/benchmark/benchmark.js index 394f4c58e8bd..608ea5ff2d91 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercosf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/acovercosf/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pkg = require( './../package.json' ).name; var acovercosf = require( './../lib' ); @@ -34,7 +34,9 @@ bench( pkg, function benchmark( b ) { var y; var i; - x = randu( 100, -2.0, 0.0 ); + x = uniform( 100, -2.0, 0.0, { + 'dtype': 'float32' + }); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/acovercosf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/acovercosf/benchmark/benchmark.native.js index 688cf38c802a..8c496b86509c 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercosf/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/acovercosf/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,7 +43,9 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; - x = randu( 100, -2.0, 0.0 ); + x = uniform( 100, -2.0, 0.0, { + 'dtype': 'float32' + }); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/benchmark.js index 7b10ba0e7b0d..6f84697c381d 100644 --- a/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/acoversin/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 acoversin = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, 0.0, 2.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( 2.0*randu() ) - 0.0; - y = acoversin( x ); + y = acoversin( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/benchmark.native.js index 44f2e5369e4e..983dfcb01e31 100644 --- a/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/acoversin/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,11 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, 0.0, 2.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*2.0 ); - y = acoversin( x ); + y = acoversin( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/c/benchmark.c index 93d213864f9b..51eb03e8c231 100644 --- a/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/c/benchmark.c @@ -89,16 +89,19 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 2.0*rand_double() ) - 0.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 2.0*rand_double() ) - 0.0; - y = asin( 1.0 - x ); + y = asin( 1.0 - x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/c/native/benchmark.c index 2434c89e5d04..b7df9a4e70c5 100644 --- a/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/acoversin/benchmark/c/native/benchmark.c @@ -90,16 +90,19 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 2.0*rand_double() ); + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 2.0*rand_double() ); - y = stdlib_base_acoversin( x ); + y = stdlib_base_acoversin( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/acoversin/test/test.js b/lib/node_modules/@stdlib/math/base/special/acoversin/test/test.js index 69dc62f16de2..761980d6f730 100644 --- a/lib/node_modules/@stdlib/math/base/special/acoversin/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/acoversin/test/test.js @@ -92,7 +92,7 @@ tape( 'the function computes the inverse coversed sine (small positive numbers)' tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { var v = acoversin( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -101,7 +101,7 @@ tape( 'the function returns `NaN` if provided a value less than `0`', function t var i; for ( i = 0; i < 1e4; i++ ) { v = -(randu()*1.0e6) - (0.0+EPS); - t.strictEqual( isnan( acoversin( v ) ), true, 'returns NaN when provided '+v ); + t.strictEqual( isnan( acoversin( v ) ), true, 'returns expected value when provided '+v ); } t.end(); }); @@ -111,7 +111,7 @@ tape( 'the function returns `NaN` if provided a value greater than `2`', functio var i; for ( i = 0; i < 1e4; i++ ) { v = (randu()*1.0e6) + 2.0 + EPS; - t.strictEqual( isnan( acoversin( v ) ), true, 'returns NaN when provided '+v ); + t.strictEqual( isnan( acoversin( v ) ), true, 'returns expected value when provided '+v ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/acoversin/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/acoversin/test/test.native.js index 01ae57b740ea..b42d673cfbda 100644 --- a/lib/node_modules/@stdlib/math/base/special/acoversin/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/acoversin/test/test.native.js @@ -101,7 +101,7 @@ tape( 'the function computes the inverse coversed sine (small positive numbers)' tape( 'the function returns `NaN` if provided `NaN`', opts, function test( t ) { var v = acoversin( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -110,7 +110,7 @@ tape( 'the function returns `NaN` if provided a value less than `0`', opts, func var i; for ( i = 0; i < 1e4; i++ ) { v = -(randu()*1.0e6) - (0.0+EPS); - t.strictEqual( isnan( acoversin( v ) ), true, 'returns NaN when provided '+v ); + t.strictEqual( isnan( acoversin( v ) ), true, 'returns expected value when provided '+v ); } t.end(); }); @@ -120,7 +120,7 @@ tape( 'the function returns `NaN` if provided a value greater than `2`', opts, f var i; for ( i = 0; i < 1e4; i++ ) { v = (randu()*1.0e6) + 2.0 + EPS; - t.strictEqual( isnan( acoversin( v ) ), true, 'returns NaN when provided '+v ); + t.strictEqual( isnan( acoversin( v ) ), true, 'returns expected value when provided '+v ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/acoversinf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/acoversinf/benchmark/benchmark.js index 81e4c81f74e8..3faa7a9acbe1 100644 --- a/lib/node_modules/@stdlib/math/base/special/acoversinf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/acoversinf/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pkg = require( './../package.json' ).name; var acoversinf = require( './../lib' ); @@ -34,7 +34,9 @@ bench( pkg, function benchmark( b ) { var y; var i; - x = randu( 100, 0.0, 2.0 ); + x = uniform( 100, 0.0, 2.0, { + 'dtype': 'float32' + }); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/acoversinf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/acoversinf/benchmark/benchmark.native.js index 8228fbe2aaf0..cfb7bfda199b 100644 --- a/lib/node_modules/@stdlib/math/base/special/acoversinf/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/acoversinf/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/array/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,7 +43,9 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; - x = randu( 100, 0.0, 2.0 ); + x = uniform( 100, 0.0, 2.0, { + 'dtype': 'float32' + }); b.tic(); for ( i = 0; i < b.iterations; i++ ) {