diff --git a/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/benchmark.js index f7f360aae04d..14e2e288aa12 100644 --- a/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/vercos/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 vercos = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -10.0, 10.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*20.0 ) - 10.0; - y = vercos( x ); + y = vercos( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/benchmark.native.js index 0bc47a6af74d..ab9c5a1c5802 100644 --- a/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/vercos/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, -10.0, 10.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 20.0 ) - 10.0; - y = vercos( x ); + y = vercos( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/c/benchmark.c index 60ff7d6430b4..a4d3c8effc47 100644 --- a/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/vercos/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 ] = ( 20.0*rand_double() ) - 10.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 20.0*rand_double() ) - 10.0; - y = 1.0 + cos( x ); + y = 1.0 + cos( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/c/native/benchmark.c index 8ce17575fddf..31080bc5b561 100644 --- a/lib/node_modules/@stdlib/math/base/special/vercos/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/vercos/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 ] = ( 20.0 * rand_double() ) - 10.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 20.0 * rand_double() ) - 10.0; - y = stdlib_base_vercos( x ); + y = stdlib_base_vercos( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/vercos/test/test.js b/lib/node_modules/@stdlib/math/base/special/vercos/test/test.js index ed9ba7b57b42..646321831b06 100644 --- a/lib/node_modules/@stdlib/math/base/special/vercos/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/vercos/test/test.js @@ -199,18 +199,18 @@ tape( 'the function computes the versed cosine (for x >= 2**60 (PI/2) )', functi tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var v = vercos( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided `+infinity`', function test( t ) { var v = vercos( PINF ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided `-infinity`', function test( t ) { var v = vercos( NINF ); - 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/versin/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/versin/benchmark/benchmark.js index 909679e42f23..d6275d7ee544 100644 --- a/lib/node_modules/@stdlib/math/base/special/versin/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/versin/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 versin = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -10.0, 10.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*20.0 ) - 10.0; - y = versin( x ); + y = versin( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/versin/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/versin/benchmark/benchmark.native.js index 4fecc8eb674a..54f6dbd0f48e 100644 --- a/lib/node_modules/@stdlib/math/base/special/versin/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/versin/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, -10.0, 10.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 20.0 ) - 10.0; - y = versin( x ); + y = versin( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/versin/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/versin/benchmark/c/benchmark.c index 4c7ad2db2da3..956171b6dd2b 100644 --- a/lib/node_modules/@stdlib/math/base/special/versin/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/versin/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 ] = ( 20.0*rand_double() ) - 10.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 20.0*rand_double() ) - 10.0; - y = 1.0 - cos( x ); + y = 1.0 - cos( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/versin/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/versin/benchmark/c/native/benchmark.c index fe5551d6f338..b5406f497b85 100644 --- a/lib/node_modules/@stdlib/math/base/special/versin/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/versin/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 ] = ( 20.0 * rand_double() ) - 10.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 20.0 * rand_double() ) - 10.0; - y = stdlib_base_versin( x ); + y = stdlib_base_versin( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/versin/test/test.js b/lib/node_modules/@stdlib/math/base/special/versin/test/test.js index 75763e87ca71..1c50cdb2f88e 100644 --- a/lib/node_modules/@stdlib/math/base/special/versin/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/versin/test/test.js @@ -199,18 +199,18 @@ tape( 'the function computes the versed sine (for x >= 2**60 (PI/2) )', function tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var v = versin( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided `+infinity`', function test( t ) { var v = versin( PINF ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided `-infinity`', function test( t ) { var v = versin( NINF ); - 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/wrap/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/benchmark.js index 6b6c9a380d43..b5ba659d13ac 100644 --- a/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/wrap/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 wrap = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -10.0, 10.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*20.0 ) - 10.0; - y = wrap( x, -5.0, 5.0 ); + y = wrap( x[ i % x.length ], -5.0, 5.0 ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/benchmark.native.js index bb84112826da..b0f3fc7a5d47 100644 --- a/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/wrap/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, -10.0, 10.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*20.0 ) - 10.0; - y = wrap( x, -5.0, 5.0 ); + y = wrap( x[ i % x.length ], -5.0, 5.0 ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/c/benchmark.c index 5ecd84126d5e..c55c87de2273 100644 --- a/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/c/benchmark.c @@ -110,16 +110,19 @@ double wrap( double v, double min, double max ) { * @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 ] = ( 20.0*rand_double() ) - 10.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 20.0*rand_double() ) - 10.0; - y = wrap( x, -5.0, 5.0 ); + y = wrap( x[ i%100 ], -5.0, 5.0 ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/c/native/benchmark.c index ab5e20262367..9ed2dd0f11aa 100644 --- a/lib/node_modules/@stdlib/math/base/special/wrap/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/wrap/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 ] = ( 20.0*rand_double() ) - 10.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 20.0*rand_double() ) - 10.0; - y = stdlib_base_wrap( x, -5.0, 5.0 ); + y = stdlib_base_wrap( x[ i%100 ], -5.0, 5.0 ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/wrap/test/test.js b/lib/node_modules/@stdlib/math/base/special/wrap/test/test.js index 1e674a22178b..f36a608c8aa5 100644 --- a/lib/node_modules/@stdlib/math/base/special/wrap/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/wrap/test/test.js @@ -38,25 +38,25 @@ tape( 'if provided `NaN` for any argument, the function returns `NaN`', function var v; v = wrap( NaN, 0.0, 5.0 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( 0.0, NaN, 5.0 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( 3.14, 0.0, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( NaN, NaN, 5.0 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( NaN, 0.0, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( 3.14, NaN, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( NaN, NaN, 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/wrap/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/wrap/test/test.native.js index 40b1284835b2..0e8d81767183 100644 --- a/lib/node_modules/@stdlib/math/base/special/wrap/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/wrap/test/test.native.js @@ -47,25 +47,25 @@ tape( 'if provided `NaN` for any argument, the function returns `NaN`', opts, fu var v; v = wrap( NaN, 0.0, 5.0 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( 0.0, NaN, 5.0 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( 3.14, 0.0, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( NaN, NaN, 5.0 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( NaN, 0.0, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( 3.14, NaN, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = wrap( NaN, NaN, 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/xlog1py/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/xlog1py/benchmark/benchmark.js index 47b8bb4ea76b..61e20df36fcc 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlog1py/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/xlog1py/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 xlog1py = require( './../lib' ); @@ -35,11 +35,12 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, 0.0, 10.0 ); + y = uniform( 100, 0.0, 10.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = randu() * 10.0; - y = randu() * 10.0; - out = xlog1py( x, y ); + out = xlog1py( x[ i % x.length ], y[ i % y.length ] ); if ( isnan( out ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/xlog1py/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/xlog1py/benchmark/benchmark.native.js index 2ff20a9966bc..f53aab630fa6 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlog1py/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/xlog1py/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; @@ -44,11 +44,12 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, 0.0, 100.0 ); + y = uniform( 100, 0.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*100.0 ); - y = ( randu()*5.0 ); - out = xlog1py( x, y ); + out = xlog1py( x[ i % x.length ], y[ i % y.length ] ); if ( isnan( out ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/xlog1py/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/xlog1py/benchmark/c/native/benchmark.c index 6d56ccda9b6b..7a2a9c85014b 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlog1py/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/xlog1py/benchmark/c/native/benchmark.c @@ -90,18 +90,21 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; + double y[ 100 ]; double elapsed; double out; - double x; - double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 100.0*rand_double() ); + y[ i ] = ( 5.0*rand_double() ); + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 100.0*rand_double() ); - y = ( 5.0*rand_double() ); - out = stdlib_base_xlog1py( x, y ); + out = stdlib_base_xlog1py( x[ i%100 ], y[ i%100 ] ); if ( out != out ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.js b/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.js index 0f93dcfafd40..b087ccf77ae0 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.js @@ -45,31 +45,31 @@ tape( 'main export is a function', function test( t ) { tape( 'the function returns `NaN` when provided `NaN` for any parameter', function test( t ) { var out = xlog1py( NaN, 2.0 ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlog1py( 0.0, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlog1py( 3.4, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlog1py( NaN, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `0` when `x = 0` and `y` is a number', function test( t ) { var out = xlog1py( 0.0, 2.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); out = xlog1py( 0.0, 0.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); out = xlog1py( 0.0, -1.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); out = xlog1py( 0.0, -3.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.native.js index e0d92de0ad3f..1be8701e11cb 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/xlog1py/test/test.native.js @@ -54,31 +54,31 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function returns `NaN` when provided `NaN` for any parameter', opts, function test( t ) { var out = xlog1py( NaN, 2.0 ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlog1py( 0.0, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlog1py( 3.4, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlog1py( NaN, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `0` when `x = 0` and `y` is a number', opts, function test( t ) { var out = xlog1py( 0.0, 2.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); out = xlog1py( 0.0, 0.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); out = xlog1py( 0.0, -1.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); out = xlog1py( 0.0, -3.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/xlogy/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/xlogy/benchmark/benchmark.js index dbbf51a45e2d..ef4ea9a521dd 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlogy/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/xlogy/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 xlogy = require( './../lib' ); @@ -35,11 +35,12 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, 0.0, 10.0 ); + y = uniform( 100, 0.0, 10.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = randu() * 10.0; - y = randu() * 10.0; - out = xlogy( x, y ); + out = xlogy( x[ i % x.length ], y[ i % y.length ] ); if ( isnan( out ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/xlogy/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/xlogy/benchmark/benchmark.native.js index ebb3cc5b1e81..22c972d4063e 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlogy/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/xlogy/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; @@ -44,11 +44,12 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, 0.0, 100.0 ); + y = uniform( 100, 0.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*100.0 ); - y = ( randu()*5.0 ); - out = xlogy( x, y ); + out = xlogy( x[ i % x.length ], y[ i % y.length ] ); if ( isnan( out ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/xlogy/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/xlogy/benchmark/c/native/benchmark.c index af8328fc2b4e..9276b3d742b6 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlogy/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/xlogy/benchmark/c/native/benchmark.c @@ -90,18 +90,21 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; + double y[ 100 ]; double elapsed; double out; - double x; - double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = 100.0 * rand_double(); + y[ i ] = 5.0 * rand_double(); + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 100.0*rand_double() ); - y = ( 5.0*rand_double() ); - out = stdlib_base_xlogy( x, y ); + out = stdlib_base_xlogy( x[ i%100 ], y[ i%100 ] ); if ( out != out ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/xlogy/test/test.js b/lib/node_modules/@stdlib/math/base/special/xlogy/test/test.js index e3876deb41c7..c197d7b4e8db 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlogy/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/xlogy/test/test.js @@ -45,28 +45,28 @@ tape( 'main export is a function', function test( t ) { tape( 'the function returns `NaN` when provided `NaN` for any parameter', function test( t ) { var out = xlogy( NaN, 2.0 ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlogy( 0.0, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlogy( 3.4, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlogy( NaN, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `0` when `x = 0` and `y` is a number', function test( t ) { var out = xlogy( 0.0, 2.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); out = xlogy( 0.0, 0.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); out = xlogy( 0.0, -3.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/xlogy/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/xlogy/test/test.native.js index 2ab0b69a14ab..aec430935ccf 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlogy/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/xlogy/test/test.native.js @@ -60,28 +60,28 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function returns `NaN` when provided `NaN` for any parameter', opts, function test( t ) { var out = xlogy( NaN, 2.0 ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlogy( 0.0, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlogy( 3.4, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); out = xlogy( NaN, NaN ); - t.strictEqual( isnan( out ), true, 'returns NaN' ); + t.strictEqual( isnan( out ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `0` when `x = 0` and `y` is a number', opts, function test( t ) { var out = xlogy( 0.0, 2.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); out = xlogy( 0.0, 0.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); out = xlogy( 0.0, -3.0 ); - t.strictEqual( out, 0.0, 'returns 0' ); + t.strictEqual( out, 0.0, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/xlogyf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/xlogyf/benchmark/benchmark.js index d6b6b831d14b..ff07cff94ef5 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlogyf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/xlogyf/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 xlogyf = require( './../lib' ); @@ -35,8 +35,12 @@ bench( pkg, function benchmark( b ) { var y; var i; - x = randu( 100, 1.0, 100.0 ); - y = randu( 100, 1.0, 100.0 ); + x = uniform( 100, 1.0, 100.0, { + 'dtype': 'float32' + }); + y = uniform( 100, 1.0, 100.0, { + 'dtype': 'float32' + }); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/xlogyf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/xlogyf/benchmark/benchmark.native.js index 97878c60e01a..3f1369afe057 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlogyf/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/xlogyf/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; @@ -44,8 +44,12 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; - x = randu( 100, 1.0, 100.0 ); - y = randu( 100, 1.0, 100.0 ); + x = uniform( 100, 1.0, 100.0, { + 'dtype': 'float32' + }); + y = uniform( 100, 1.0, 100.0, { + 'dtype': 'float32' + }); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/xlogyf/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/xlogyf/benchmark/c/native/benchmark.c index 895f3d47b7c2..b60cbb961168 100644 --- a/lib/node_modules/@stdlib/math/base/special/xlogyf/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/xlogyf/benchmark/c/native/benchmark.c @@ -91,20 +91,20 @@ static float rand_float( void ) { */ static double benchmark( void ) { double elapsed; - float out; double t; float x[ 100 ]; float y[ 100 ]; + float out; int i; for ( i = 0; i < 100; i++ ) { - x[ i ] = ( 100.0f * rand_float() ); - y[ i ] = ( 5.0f * rand_float() ); + x[ i ] = 100.0f * rand_float(); + y[ i ] = 5.0f * rand_float(); } t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - out = stdlib_base_xlogyf( x[ i % 100 ], y[ i % 100 ] ); + out = stdlib_base_xlogyf( x[ i%100 ], y[ i%100 ] ); if ( out != out ) { printf( "should not return NaN\n" ); break;