diff --git a/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/benchmark.js index c94487b7a245..6057a00654d8 100644 --- a/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/covercos/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 covercos = 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 = covercos( x ); + y = covercos( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/benchmark.native.js index 35e1337014b1..1e6d15bedd15 100644 --- a/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/covercos/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 = covercos( x ); + y = covercos( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/c/benchmark.c index f51045c27824..3f99dd1fdc6a 100644 --- a/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/covercos/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 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 + sin( x ); + y = 1.0 + sin( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/c/native/benchmark.c index 524855297b3c..8e8bedeb771c 100644 --- a/lib/node_modules/@stdlib/math/base/special/covercos/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/covercos/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 ] = ( 20.0 * rand_double() ) - 10.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 20.0 * rand_double() ) - 10.0; - y = stdlib_base_covercos( x ); + y = stdlib_base_covercos( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/covercos/test/test.js b/lib/node_modules/@stdlib/math/base/special/covercos/test/test.js index e4f98d4c8dc7..6a39936c1efd 100644 --- a/lib/node_modules/@stdlib/math/base/special/covercos/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/covercos/test/test.js @@ -193,18 +193,18 @@ tape( 'the function computes the coversed cosine (for x >= 2**60 (PI/2))', funct tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { var v = covercos( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided `+infinity`', function test( t ) { var v = covercos( PINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided `-infinity`', function test( t ) { var v = covercos( NINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/benchmark.js index d22302356904..6d1022cf578f 100644 --- a/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/coversin/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 coversin = 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 = coversin( x ); + y = coversin( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/benchmark.native.js index 520034a2f019..48246a704954 100644 --- a/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/coversin/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 = coversin( x ); + y = coversin( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/c/benchmark.c index c31e9263d7ff..fe1921f18aa6 100644 --- a/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/coversin/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 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 - sin( x ); + y = 1.0 - sin( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/c/native/benchmark.c index ee231abd3e36..7600597820bb 100644 --- a/lib/node_modules/@stdlib/math/base/special/coversin/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/coversin/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 ] = ( 20.0 * rand_double() ) - 10.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 20.0 * rand_double() ) - 10.0; - y = stdlib_base_coversin( x ); + y = stdlib_base_coversin( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/coversin/test/test.js b/lib/node_modules/@stdlib/math/base/special/coversin/test/test.js index d694c84b4c6f..2231a911b3c3 100644 --- a/lib/node_modules/@stdlib/math/base/special/coversin/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/coversin/test/test.js @@ -193,18 +193,18 @@ tape( 'the function computes the coversine (for x >= 2**60 (PI/2))', function te tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { var v = coversin( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided `+infinity`', function test( t ) { var v = coversin( PINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided `-infinity`', function test( t ) { var v = coversin( NINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/coversin/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/coversin/test/test.native.js index 615763453568..86fee42d1912 100644 --- a/lib/node_modules/@stdlib/math/base/special/coversin/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/coversin/test/test.native.js @@ -202,18 +202,18 @@ tape( 'the function computes the coversine (for x >= 2**60 (PI/2))', opts, funct tape( 'the function returns `NaN` if provided `NaN`', opts, function test( t ) { var v = coversin( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided `+infinity`', opts, function test( t ) { var v = coversin( PINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `NaN` if provided `-infinity`', opts, function test( t ) { var v = coversin( NINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); });