diff --git a/lib/node_modules/@stdlib/math/base/special/csc/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/csc/benchmark/benchmark.js index 34ea88bbeb99..1692e991b717 100644 --- a/lib/node_modules/@stdlib/math/base/special/csc/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/csc/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 sin = require( '@stdlib/math/base/special/sin' ); var pkg = require( './../package.json' ).name; @@ -35,10 +35,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 = csc( x ); + y = csc( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } @@ -56,10 +57,11 @@ bench( pkg + '::built-in', 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 = 1.0 / sin( x ); + y = 1.0 / sin( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/csc/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/csc/benchmark/benchmark.native.js index 8edc21b0c189..1947d8e64973 100644 --- a/lib/node_modules/@stdlib/math/base/special/csc/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/csc/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 = csc( x ); + y = csc( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/csc/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/csc/benchmark/c/native/benchmark.c index a6ef53709dc3..bcec6719493d 100644 --- a/lib/node_modules/@stdlib/math/base/special/csc/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/csc/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_csc( x ); + y = stdlib_base_csc( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/csc/test/test.js b/lib/node_modules/@stdlib/math/base/special/csc/test/test.js index f691292a5935..a90174c796e6 100644 --- a/lib/node_modules/@stdlib/math/base/special/csc/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/csc/test/test.js @@ -379,18 +379,18 @@ tape( 'if provided a multiple of `pi`, the function does not return `~-infinity` tape( 'if provided a `NaN`, the function returns `NaN`', function test( t ) { var v = csc(NaN); - t.equal(isnan(v), true, 'returns NaN'); + t.equal(isnan(v), true, 'returns expected value'); t.end(); }); tape( 'if provided `+infinity`, the function returns `NaN`', function test( t ) { var v = csc(PINF); - t.equal(isnan(v), true, 'returns NaN'); + t.equal(isnan(v), true, 'returns expected value'); t.end(); }); tape( 'if provided `-infinity`, the function returns `NaN`', function test( t ) { var v = csc(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/csc/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/csc/test/test.native.js index 0c1d4c6cb3ce..b85dc28f267c 100644 --- a/lib/node_modules/@stdlib/math/base/special/csc/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/csc/test/test.native.js @@ -388,18 +388,18 @@ tape( 'if provided a multiple of `pi`, the function does not return `~-infinity` tape( 'if provided a `NaN`, the function returns `expected value`', opts, function test( t ) { var v = csc(NaN); - t.equal(isnan(v), true, 'returns NaN'); + t.equal(isnan(v), true, 'returns expected value'); t.end(); }); tape( 'if provided `+infinity`, the function returns `expected value`', opts, function test( t ) { var v = csc(PINF); - t.equal(isnan(v), true, 'returns NaN'); + t.equal(isnan(v), true, 'returns expected value'); t.end(); }); tape( 'if provided `-infinity`, the function returns `expected value`', opts, function test( t ) { var v = csc(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/cscd/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/cscd/benchmark/benchmark.js index 1b403016a3ef..c1bfa93b8003 100644 --- a/lib/node_modules/@stdlib/math/base/special/cscd/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/cscd/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 cscd = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, 1.0, 3.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*2.0 ) + 1.0; - y = cscd( x ); + y = cscd( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/cscd/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/cscd/benchmark/benchmark.native.js index c6b180df7832..13ed2ae0eca1 100644 --- a/lib/node_modules/@stdlib/math/base/special/cscd/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/cscd/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, 1.0, 3.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 2.0 ) + 1.0; - y = cscd( x ); + y = cscd( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/cscd/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/cscd/benchmark/c/native/benchmark.c index c298c38f90c5..f18a5fadd83e 100644 --- a/lib/node_modules/@stdlib/math/base/special/cscd/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/cscd/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 ] = ( 2.0 * rand_double() ) + 1.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 2.0 * rand_double() ) + 1.0; - y = stdlib_base_cscd( x ); + y = stdlib_base_cscd( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.js index 0d6d6f162aae..1f2bb8b03512 100644 --- a/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/csch/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var csch = require( './../lib' ); @@ -34,7 +34,7 @@ bench( pkg, function benchmark( b ) { var y; var i; - x = randu( 100, -5.0, 5.0 ); + x = uniform( 100, -5.0, 5.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.native.js index 5d4a51a88129..118eeaab99e6 100644 --- a/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/csch/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,7 +43,7 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; - x = randu( 100, -5.0, 5.0 ); + x = uniform( 100, -5.0, 5.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) {