diff --git a/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.js index ec3084cbf560..c654c7d2a26c 100644 --- a/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var randu = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var rempio2 = require( './../lib' ); @@ -36,11 +36,11 @@ bench( pkg, function benchmark( b ) { var i; y = [ 0.0, 0.0 ]; + x = randu( 100, -100.0, 100.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*200.0 ) - 100.0; - n = rempio2( x, y ); + n = rempio2( x[ i % x.length ], y ); if ( isnan( n ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.native.js index ba0fa56577dd..d231943ea28c 100644 --- a/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/rempio2/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 randu = 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; @@ -45,11 +45,11 @@ bench( pkg+'::native', opts, function benchmark( b ) { var i; y = [ 0.0, 0.0 ]; + x = randu( 100, -100.0, 100.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 200.0 ) - 100.0; - n = rempio2( x, y ); + n = rempio2( x[ i % x.length ], y ); if ( isnan( n ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/c/native/benchmark.c index 1b483967fe60..293062cc950f 100644 --- a/lib/node_modules/@stdlib/math/base/special/rempio2/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/rempio2/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 elapsed; double rem1; double rem2; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_double() * 200.0 ) - 100.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( rand_double() * 200.0 ) - 100.0; - y = stdlib_base_rempio2( x, &rem1, &rem2 ); + y = stdlib_base_rempio2( x[ i % 100 ], &rem1, &rem2 ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/rempio2/src/main.c b/lib/node_modules/@stdlib/math/base/special/rempio2/src/main.c index 1e3baf3d867c..0384913710a3 100644 --- a/lib/node_modules/@stdlib/math/base/special/rempio2/src/main.c +++ b/lib/node_modules/@stdlib/math/base/special/rempio2/src/main.c @@ -227,8 +227,7 @@ static const double PIO2[] = { * - The hexadecimal values are the intended ones for the following constants. The decimal values may be used, provided that the compiler will convert from decimal to binary accurately enough to produce the hexadecimal values shown. * * @param x input value -* @param rem1 remainder element 1 -* @param rem2 remainder element 2 +* @param y output array to store the remainder * @param e0 the exponent of `x[0]` (must be <= 16360) * @param nx dimension of `x[]` * @return last 3 binary digits