diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ccis/benchmark/c/benchmark.c index 9df5d7cd1156..35e252f391f4 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ccis/benchmark/c/benchmark.c @@ -89,20 +89,22 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double re[ 100 ]; + double im[ 100 ]; double elapsed; - double re; - double im; double t; int i; double complex z; + for ( i = 0; i < 100; i++ ) { + re[ i ] = ( 100.0*rand_double() ) - 50.0; + im[ i ] = ( 100.0*rand_double() ) - 50.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 100.0*rand_double() ) - 50.0; - im = ( 100.0*rand_double() ) - 50.0; - - z = ( cos( re ) + I * sin( re ) ) / exp( im ); + z = ( cos( re[ i%100 ] ) + I * sin( re[ i%100 ] ) ) / exp( im[ i%100 ] ); if ( z != z ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ccis/benchmark/c/native/benchmark.c index 7a6edaf59274..48a6c4ac9372 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ccis/benchmark/c/native/benchmark.c @@ -92,23 +92,26 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double re[ 100 ]; + double im[ 100 ]; double elapsed; - double re; - double im; double t; int i; stdlib_complex128_t z1; stdlib_complex128_t z2; + for ( i = 0; i < 100; i++ ) { + re[ i ] = ( 1000.0*rand_double() ) - 500.0; + im[ i ] = ( 1000.0*rand_double() ) - 500.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - re = ( 1000.0*rand_double() ) - 500.0; - im = ( 1000.0*rand_double() ) - 500.0; - z1 = stdlib_complex128( re, im ); + z1 = stdlib_complex128( re[ i%100 ], im[ i%100 ] ); z2 = stdlib_base_ccis( z1 ); - stdlib_complex128_reim( z2, &re, &im ); + stdlib_complex128_reim( z2, &re[ i%100 ], &im[ i%100 ] ); if ( re != re ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/test/test.js b/lib/node_modules/@stdlib/math/base/special/ccis/test/test.js index cbd7717e3ee8..7ab1ed569d20 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/ccis/test/test.js @@ -139,8 +139,8 @@ tape( 'if real component is `+Infinity`, all components are `NaN`', function tes var v; v = ccis( new Complex128( PINF, 0.0 ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); t.end(); }); @@ -148,8 +148,8 @@ tape( 'if real component is `-Infinity`, all components are `NaN`', function tes var v; v = ccis( new Complex128( NINF, 0.0 ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); t.end(); }); @@ -171,7 +171,7 @@ tape( 'if imaginary component is `-Infinity`, the function computes the correct t.strictEqual( real( v ), PINF, 'returns +Infinity' ); // The imaginary component is computed as Infinity * 0.0 = NaN: - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); t.end(); }); @@ -179,16 +179,16 @@ tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', fun var v; v = ccis( new Complex128( NaN, 3.0 ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); v = ccis( new Complex128( 5.0, NaN ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); v = ccis( new Complex128( NaN, NaN ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/ccis/test/test.native.js index d6d8d9edaf84..3e06ff1e76ea 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ccis/test/test.native.js @@ -149,8 +149,8 @@ tape( 'if real component is `+Infinity`, all components are `NaN`', opts, functi var v; v = ccis( new Complex128( PINF, 0.0 ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); t.end(); }); @@ -158,8 +158,8 @@ tape( 'if real component is `-Infinity`, all components are `NaN`', opts, functi var v; v = ccis( new Complex128( NINF, 0.0 ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); t.end(); }); @@ -181,7 +181,7 @@ tape( 'if imaginary component is `-Infinity`, the function computes the correct t.strictEqual( real( v ), PINF, 'returns +Infinity' ); // The imaginary component is computed as Infinity * 0.0 = NaN: - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); t.end(); }); @@ -189,16 +189,16 @@ tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', opt var v; v = ccis( new Complex128( NaN, 3.0 ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); v = ccis( new Complex128( 5.0, NaN ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); v = ccis( new Complex128( NaN, NaN ) ); - t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); - t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); + t.strictEqual( isnan( real( v ) ), true, 'returns expected value' ); + t.strictEqual( isnan( imag( v ) ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/benchmark.js index 1d0bf7119c2e..24450423b716 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/ceil/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 ceil = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -500.0, 500.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1000.0 ) - 500.0; - y = ceil( x ); + y = ceil( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } @@ -55,10 +56,11 @@ bench( pkg+'::built-in', function benchmark( b ) { var y; var i; + x = uniform( 100, -500.0, 500.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1000.0 ) - 500.0; - y = Math.ceil( x ); // eslint-disable-line stdlib/no-builtin-math + y = Math.ceil( x[ i%x.length ] ); // eslint-disable-line stdlib/no-builtin-math if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/benchmark.native.js index f48e378e4d3b..a357c046696d 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ceil/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, -500.0, 500.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1000.0 ) - 500.0; - y = ceil( x ); + y = ceil( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/c/benchmark.c index 745172a6a0c1..2f1f2151074c 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ceil/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 ] = ( 1000.0*rand_double() ) - 500.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1000.0*rand_double() ) - 500.0; - y = ceil( x ); + y = ceil( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/c/cephes/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/c/cephes/benchmark.c index dde7df76a6c5..5f364daa5bb0 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/c/cephes/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/c/cephes/benchmark.c @@ -94,16 +94,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 ] = ( 1000.0*rand_double() ) - 500.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1000.0*rand_double() ) - 500.0; - y = ceil( x ); + y = ceil( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/c/native/benchmark.c index 4c179b08819e..d5538eee401a 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ceil/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 ] = ( 1000.0*rand_double() ) - 500.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1000.0*rand_double() ) - 500.0; - y = stdlib_base_ceil( x ); + y = stdlib_base_ceil( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ceil/test/test.js b/lib/node_modules/@stdlib/math/base/special/ceil/test/test.js index bf15a9b1f552..31469d1200f1 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/ceil/test/test.js @@ -46,7 +46,7 @@ tape( 'the function returns the largest integer greater than or equal to a given tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var val = ceil( NaN ); - t.strictEqual( isnan( val ), true, 'returns NaN' ); + t.strictEqual( isnan( val ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/ceil/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/ceil/test/test.native.js index 20d4fd4bc253..4d98364a7090 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ceil/test/test.native.js @@ -55,7 +55,7 @@ tape( 'the function returns the largest integer greater than or equal to a given tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t ) { var val = ceil( NaN ); - t.strictEqual( isnan( val ), true, 'returns NaN' ); + t.strictEqual( isnan( val ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/ceil10/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/ceil10/benchmark/benchmark.js index f9402cfdf9bc..1af3abd781de 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil10/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/ceil10/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 ceil10 = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = ceil10( x ); + y = ceil10( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceil10/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/ceil10/benchmark/benchmark.native.js index 26f8cff262e4..72b1881342b1 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil10/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ceil10/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, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 1.0e7 ) - 5.0e6; - y = ceil10( x ); + y = ceil10( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceil10/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ceil10/benchmark/c/native/benchmark.c index da1d8a79c5f4..33b4b48ef6d7 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil10/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ceil10/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 ] = ( 1.0e7 * rand_double() ) - 5.0e6; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1.0e7 * rand_double() ) - 5.0e6; - y = stdlib_base_ceil10( x ); + y = stdlib_base_ceil10( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ceil10/test/test.js b/lib/node_modules/@stdlib/math/base/special/ceil10/test/test.js index f54453373744..c9f1ca0ff6e2 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil10/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/ceil10/test/test.js @@ -58,7 +58,7 @@ tape( 'the function returns `-0` if provided `-0`', function test( t ) { tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var v = ceil10( 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/ceil2/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/ceil2/benchmark/benchmark.js index fbb1806f76a7..56ab0dfbdfe5 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/ceil2/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 ceil2 = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = ceil2( x ); + y = ceil2( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceil2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/ceil2/benchmark/benchmark.native.js index c27ff534bab1..e7c9322f324d 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ceil2/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, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 1.0e7 ) - 5.0e6; - y = ceil2( x ); + y = ceil2( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceil2/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ceil2/benchmark/c/native/benchmark.c index b57f349139e4..c1584df136bd 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil2/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ceil2/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 ] = ( 1.0e7 * rand_double() ) - 5.0e6; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1.0e7 * rand_double() ) - 5.0e6; - y = stdlib_base_ceil2( x ); + y = stdlib_base_ceil2( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ceil2/test/test.js b/lib/node_modules/@stdlib/math/base/special/ceil2/test/test.js index a847e2b2086b..85115c552332 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceil2/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/ceil2/test/test.js @@ -60,7 +60,7 @@ tape( 'the function returns `-0` if provided `-0`', function test( t ) { tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var v = ceil2( 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/ceilb/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/ceilb/benchmark/benchmark.js index 06f3c205c7dd..d879fa7b94b2 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilb/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/ceilb/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 ceilb = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = ceilb( x, 2, 20 ); + y = ceilb( x[ i%x.length ], 2, 20 ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceilb/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/ceilb/benchmark/benchmark.native.js index e16a591db04c..20278ac87d91 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilb/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ceilb/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, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 1.0e7 ) - 5.0e6; - y = ceilb( x, 2, 20 ); + y = ceilb( x[ i%x.length ], 2, 20 ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceilb/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ceilb/benchmark/c/native/benchmark.c index ba9cda2cc7db..8197a8681513 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilb/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ceilb/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 ] = ( 1.0e7 * rand_double() ) - 5.0e6; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1.0e7 * rand_double() ) - 5.0e6; - y = stdlib_base_ceilb( x, 2, 20 ); + y = stdlib_base_ceilb( x[ i%100 ], 2, 20 ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ceilb/test/test.js b/lib/node_modules/@stdlib/math/base/special/ceilb/test/test.js index 4ed8206a405c..2bff547f2e67 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilb/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/ceilb/test/test.js @@ -48,25 +48,25 @@ tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { var v; v = ceilb( NaN, -2, 1 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilb( 12368.0, NaN, 1 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilb( NaN, NaN, 1 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilb( 12368.0, NaN, 1 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilb( 12368.0, 1, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilb( 12368.0, NaN, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilb( NaN, 1, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -75,10 +75,10 @@ tape( 'the function returns `NaN` if provided `n = +-infinity`', function test( var v; v = ceilb( PI, PINF, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilb( PI, NINF, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -87,10 +87,10 @@ tape( 'the function returns `NaN` if provided `b = +-infinity`', function test( var v; v = ceilb( PI, 1, PINF ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilb( PI, 1, NINF ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -99,10 +99,10 @@ tape( 'the function returns `NaN` if provided `b <= 0`', function test( t ) { var v; v = ceilb( PI, 5, 0 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilb( PI, 5, -1 ); - 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/ceilb/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/ceilb/test/test.native.js index 00e1fa544d11..30cb0f03622f 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilb/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ceilb/test/test.native.js @@ -57,7 +57,7 @@ tape( 'the function returns `NaN` if provided `NaN`', opts, function test( t ) { var v; v = ceilb( NaN, -2, 1 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -65,10 +65,10 @@ tape( 'the function returns `NaN` if provided `b <= 0`', opts, function test( t var v; v = ceilb( PI, 5, 0 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilb( PI, 5, -1 ); - 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/ceilf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/benchmark.js index 0cd3118d28fc..d8d9b36a828b 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/ceilf/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 ceilf = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -500.0, 500.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1000.0 ) - 500.0; - y = ceilf( x ); + y = ceilf( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } @@ -55,10 +56,11 @@ bench( pkg+'::built-in', function benchmark( b ) { var y; var i; + x = uniform( 100, -500.0, 500.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1000.0 ) - 500.0; - y = Math.ceil( x ); // eslint-disable-line stdlib/no-builtin-math + y = Math.ceil( x[ i%x.length ] ); // eslint-disable-line stdlib/no-builtin-math if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/benchmark.native.js index 042b517fa3f0..3cbc7990c696 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ceilf/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, -500.0, 500.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1000.0 ) - 500.0; - y = ceilf( x ); + y = ceilf( x[ i%x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/c/benchmark.c index 9de24960f348..728b34250515 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/c/benchmark.c @@ -89,16 +89,19 @@ static float rand_float( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + float x[ 100 ]; double elapsed; - float x; float y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 1000.0f*rand_float() ) - 500.0f; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1000.0f*rand_float() ) - 500.0f; - y = ceilf( x ); + y = ceilf( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/c/native/benchmark.c index 530b45fc5356..d956ee75eeb5 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ceilf/benchmark/c/native/benchmark.c @@ -90,16 +90,19 @@ static float rand_float( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + float x[ 100 ]; double elapsed; - float x; float y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 1000.0f*rand_float() ) - 500.0f; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1000.0f*rand_float() ) - 500.0f; - y = stdlib_base_ceilf( x ); + y = stdlib_base_ceilf( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ceilf/test/test.js b/lib/node_modules/@stdlib/math/base/special/ceilf/test/test.js index bda59a39f2b2..882348364b1a 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilf/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/ceilf/test/test.js @@ -46,7 +46,7 @@ tape( 'the function returns the largest integer greater than or equal to a given tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var val = ceilf( NaN ); - t.strictEqual( isnanf( val ), true, 'returns NaN' ); + t.strictEqual( isnanf( val ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/ceilf/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/ceilf/test/test.native.js index 309e80cf0ec1..c0f7cd1bb204 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilf/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ceilf/test/test.native.js @@ -55,7 +55,7 @@ tape( 'the function returns the largest integer greater than or equal to a given tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t ) { var val = ceil( NaN ); - t.strictEqual( isnanf( val ), true, 'returns NaN' ); + t.strictEqual( isnanf( val ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/ceiln/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/ceiln/benchmark/benchmark.js index 1aca69cdd021..aece781e07fd 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceiln/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/ceiln/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 ceiln = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = ceiln( x, -2 ); + y = ceiln( x[ i%x.length ], -2 ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceiln/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/ceiln/benchmark/benchmark.native.js index 0e19eb4021df..7e36fa64b822 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceiln/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ceiln/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, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = ceiln( x, -2 ); + y = ceiln( x[ i%x.length ], -2 ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceiln/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ceiln/benchmark/c/native/benchmark.c index 8dcd025e25c8..99c9cfb69d63 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceiln/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ceiln/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 ] = ( 1000.0*rand_double() ) - 500.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1000.0*rand_double() ) - 500.0; - y = stdlib_base_ceiln( x, -2 ); + y = stdlib_base_ceiln( x[ i%100 ], -2 ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ceiln/test/test.js b/lib/node_modules/@stdlib/math/base/special/ceiln/test/test.js index bc2fec7534ff..b60c19cdcf42 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceiln/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/ceiln/test/test.js @@ -47,13 +47,13 @@ tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { var v; v = ceiln( NaN, -2 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceiln( 12368.0, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceiln( NaN, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -62,10 +62,10 @@ tape( 'the function returns `NaN` if provided `n = +-infinity`', function test( var v; v = ceiln( PI, PINF ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, '' ); v = ceiln( PI, NINF ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, '' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/ceiln/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/ceiln/test/test.native.js index 86fd038f2a1e..48348b08ad69 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceiln/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ceiln/test/test.native.js @@ -56,7 +56,7 @@ tape( 'the function returns `NaN` if provided `NaN`', opts, function test( t ) { var v; v = ceiln( NaN, -2 ); - 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/ceilsd/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/ceilsd/benchmark/benchmark.js index ef0cb4f02921..df0dd837a507 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilsd/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/ceilsd/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 ceilsd = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*1.0e7 ) - 5.0e6; - y = ceilsd( x, 2, 2 ); + y = ceilsd( x[ i%x.length ], 2, 2 ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceilsd/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/ceilsd/benchmark/benchmark.native.js index 128dca308fb0..7abd0de4897e 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilsd/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ceilsd/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, -5.0e6, 5.0e6 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 1.0e7 ) - 5.0e6; - y = ceilsd( x, 2, 2 ); + y = ceilsd( x[ i%x.length ], 2, 2 ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ceilsd/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ceilsd/benchmark/c/native/benchmark.c index be64eaff814e..590e77b6c207 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilsd/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/ceilsd/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 ] = ( 1.0e7 * rand_double() ) - 5.0e6; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 1.0e7 * rand_double() ) - 5.0e6; - y = stdlib_base_ceilsd( x, 2, 2 ); + y = stdlib_base_ceilsd( x[ i%100 ], 2, 2 ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/ceilsd/test/test.js b/lib/node_modules/@stdlib/math/base/special/ceilsd/test/test.js index d4442b7bbc90..cbb15a275114 100644 --- a/lib/node_modules/@stdlib/math/base/special/ceilsd/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/ceilsd/test/test.js @@ -42,25 +42,25 @@ tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { var v; v = ceilsd( NaN, 2, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilsd( 12368.0, NaN, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilsd( NaN, NaN, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilsd( NaN, NaN, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilsd( NaN, 2, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilsd( 3.14, NaN, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilsd( 3.14, 2, NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -69,10 +69,10 @@ tape( 'the function returns `NaN` if provided `n = +-infinity`', function test( var v; v = ceilsd( PI, PINF, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilsd( PI, NINF, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -81,10 +81,10 @@ tape( 'the function returns `NaN` if provided `n < 1`', function test( t ) { var v; v = ceilsd( PI, 0, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilsd( PI, -1, 10 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -93,10 +93,10 @@ tape( 'the function returns `NaN` if provided `b = +-infinity`', function test( var v; v = ceilsd( PI, 2, PINF ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilsd( PI, 2, NINF ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -105,10 +105,10 @@ tape( 'the function returns `NaN` if provided `b <= 0`', function test( t ) { var v; v = ceilsd( PI, 2, 0 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); v = ceilsd( PI, 2, -1 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); });