diff --git a/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/benchmark.c index 594df4612ec..be466a68258 100644 --- a/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/benchmark.c @@ -89,16 +89,18 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double values[ 10 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 10; i++ ) { + values[ i ] = ( 2.0*rand_double() ) - 1.0; + } t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 2.0*rand_double() ) - 1.0; - y = erf( x ); + y = erf( values[ i%10 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/cephes/benchmark.c b/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/cephes/benchmark.c index dc7e719ed8d..8b384e80285 100644 --- a/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/cephes/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/cephes/benchmark.c @@ -94,16 +94,18 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double values[ 10 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 10; i++ ) { + values[ i ] = ( 2.0*rand_double() ) - 1.0; + } t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 2.0*rand_double() ) - 1.0; - y = erf( x ); + y = erf( values[ i%10 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/native/benchmark.c index 9c0029ca465..beda7fc2bc1 100644 --- a/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/erf/benchmark/c/native/benchmark.c @@ -90,16 +90,18 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double values[ 10 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 10; i++ ) { + values[ 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_erf( x ); + y = stdlib_base_erf( values[ i%10 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break;