diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/benchmark/benchmark.js index 730c522526ae..c9c9ab13b186 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/benchmark/benchmark.js @@ -21,8 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -33,25 +32,22 @@ var logpdf = require( './../lib' ); bench( pkg, function benchmark( b ) { var gamma; - var len; + var opts; var x0; var x; var y; var i; - len = 100; - x = new Float64Array( len ); - x0 = new Float64Array( len ); - gamma = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = uniform( -100.0, 0.0 ); - x0[ i ] = uniform( -50.0, 50.0 ); - gamma[ i ] = uniform( EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, -100.0, 0.0, opts ); + x0 = uniform( 100, -50.0, 50.0, opts ); + gamma = uniform( 100, EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = logpdf( x[ i % len ], x0[ i % len ], gamma[ i % len ] ); + y = logpdf( x[ i % x.length ], x0[ i % x0.length ], gamma[ i % gamma.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } @@ -67,24 +63,24 @@ bench( pkg, function benchmark( b ) { bench( pkg+':factory', function benchmark( b ) { var mylogpdf; var gamma; - var len; + var opts; var x0; var x; var y; var i; + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, EPS, 100.0, opts ); + x0 = 0.0; gamma = 1.5; mylogpdf = logpdf.factory( x0, gamma ); - len = 100; - x = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = uniform( EPS, 100.0 ); - } b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = mylogpdf( x[ i % len ] ); + y = mylogpdf( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/benchmark/benchmark.native.js index c77c1a5c92c2..2b3dd3ecfec2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/benchmark/benchmark.native.js @@ -22,9 +22,8 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); var EPS = require( '@stdlib/constants/float64/eps' ); -var uniform = require( '@stdlib/random/base/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; @@ -42,25 +41,22 @@ var opts = { bench( pkg+'::native', opts, function benchmark( b ) { var gamma; - var len; + var opts; var x0; var x; var y; var i; - len = 100; - x = new Float64Array( len ); - x0 = new Float64Array( len ); - gamma = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = uniform( -100.0, 100.0 ); - x0[ i ] = uniform( -50.0, 50.0 ); - gamma[ i ] = uniform( EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, -100.0, 100.0, opts ); + x0 = uniform( 100, -50.0, 50.0, opts ); + gamma = uniform( 100, EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = logpdf( x[ i % len ], x0[ i % len ], gamma[ i % len ] ); + y = logpdf( x[ i % x.length ], x0[ i % x0.length ], gamma[ i % gamma.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.factory.js index cc895505ccdb..9e08ea7d7556 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.factory.js @@ -56,23 +56,23 @@ tape( 'if provided `NaN` for any parameter, the created function returns `NaN`', logpdf = factory( 0.0, 1.0 ); y = logpdf( NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); logpdf = factory( NaN, 1.0 ); y = logpdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); logpdf = factory( 1.0, NaN ); y = logpdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); logpdf = factory( NaN, NaN ); y = logpdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); logpdf = factory( NaN, NaN ); y = logpdf( NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -83,7 +83,7 @@ tape( 'if provided a valid `x0` and `gamma`, the function returns a function whi logpdf = factory( 0.0, 1.0 ); y = logpdf( PINF ); - t.equal( y, NINF, 'returns -Infinity' ); + t.equal( y, NINF, 'returns expected value' ); t.end(); }); @@ -94,7 +94,7 @@ tape( 'if provided a valid `x0` and `gamma`, the function returns a function whi logpdf = factory( 0.0, 1.0 ); y = logpdf( NINF ); - t.equal( y, NINF, 'returns -Infinity' ); + t.equal( y, NINF, 'returns expected value' ); t.end(); }); @@ -105,33 +105,33 @@ tape( 'if provided a nonpositive `gamma`, the created function always returns `N logpdf = factory( 0.0, 0.0 ); y = logpdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); logpdf = factory( 0.0, -1.0 ); y = logpdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); logpdf = factory( 0.0, NINF ); y = logpdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); logpdf = factory( PINF, NINF ); y = logpdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); logpdf = factory( NINF, NINF ); y = logpdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); logpdf = factory( NaN, NINF ); y = logpdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.logpdf.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.logpdf.js index 2f158eb40933..504066eef143 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.logpdf.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.logpdf.js @@ -48,38 +48,38 @@ tape( 'if provided `NaN` for any parameter, the function returns `NaN`', functio var y; y = logpdf( NaN, 0.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 0.0, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 0.0, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 0.0, NaN, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( NaN, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( NaN, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( NaN, NaN, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); tape( 'if provided `+infinity` for `x` and a finite `x0` and `gamma`, the function returns `-Infinity`', function test( t ) { var y = logpdf( PINF, 0.0, 1.0 ); - t.equal( y, NINF, 'returns -Infinity' ); + t.equal( y, NINF, 'returns expected value' ); t.end(); }); tape( 'if provided `-infinity` for `x` and a finite `x0` and `gamma`, the function returns `-Infinity`', function test( t ) { var y = logpdf( NINF, 0.0, 1.0 ); - t.equal( y, NINF, 'returns -Infinity' ); + t.equal( y, NINF, 'returns expected value' ); t.end(); }); @@ -87,25 +87,25 @@ tape( 'if provided a nonpositive `gamma`, the function always returns `NaN`', fu var y; y = logpdf( 2.0, 0.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 2.0, 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 0.0, 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 2.0, 0.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 2.0, PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 2.0, NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 2.0, NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.native.js index d205f3a07feb..10e26cef51ee 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/test/test.native.js @@ -57,38 +57,38 @@ tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, f var y; y = logpdf( NaN, 0.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 0.0, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 0.0, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 0.0, NaN, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( NaN, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( NaN, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( NaN, NaN, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); tape( 'if provided `+infinity` for `x` and a finite `x0` and `gamma`, the function returns `-Infinity`', opts, function test( t ) { var y = logpdf( PINF, 0.0, 1.0 ); - t.equal( y, NINF, 'returns -Infinity' ); + t.equal( y, NINF, 'returns expected value' ); t.end(); }); tape( 'if provided `-infinity` for `x` and a finite `x0` and `gamma`, the function returns `-Infinity`', opts, function test( t ) { var y = logpdf( NINF, 0.0, 1.0 ); - t.equal( y, NINF, 'returns -Infinity' ); + t.equal( y, NINF, 'returns expected value' ); t.end(); }); @@ -96,25 +96,25 @@ tape( 'if provided a nonpositive `gamma`, the function always returns `NaN`', op var y; y = logpdf( 2.0, 0.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 2.0, 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 0.0, 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 2.0, 0.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 2.0, PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 2.0, NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = logpdf( 2.0, NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/benchmark/benchmark.js index 67ed7874ad56..a0442b9dca99 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/benchmark/benchmark.js @@ -21,8 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -33,22 +32,20 @@ var median = require( './../lib' ); bench( pkg, function benchmark( b ) { var gamma; - var len; + var opts; var x0; var y; var i; - len = 100; - x0 = new Float64Array( len ); - gamma = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x0[ i ] = uniform( -50.0, 50.0 ); - gamma[ i ] = uniform( EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + x0 = uniform( 100, -50.0, 50.0, opts ); + gamma = uniform( 100, EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = median( x0[ i % len ], gamma[ i % len ] ); + y = median( x0[ i % x0.length ], gamma[ i % gamma.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/benchmark/benchmark.native.js index fa8d9329ab51..688b53478a2a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/benchmark/benchmark.native.js @@ -22,8 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var EPS = require( '@stdlib/constants/float64/eps' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -42,22 +41,20 @@ var opts = { bench( pkg+'::native', opts, function benchmark( b ) { var gamma; - var len; + var opts; var x0; var y; var i; - len = 100; - x0 = new Float64Array( len ); - gamma = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x0[ i ] = uniform( -50.0, 50.0 ); - gamma[ i ] = uniform( EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + x0 = uniform( 100, -50.0, 50.0, opts ); + gamma = uniform( 100, EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = median( x0[ i % len ], gamma[ i % len ] ); + y = median( x0[ i % x0.length ], gamma[ i % gamma.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/test/test.js index ec4c65fe938d..428fa587116c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/test/test.js @@ -42,13 +42,13 @@ tape( 'main export is a function', function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { var v = median( NaN, 0.5 ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = median( 10, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = median( NaN, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -57,16 +57,16 @@ tape( 'if provided a nonpositive `gamma`, the function always returns `NaN`', fu var y; y = median( 0.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = median( 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = median( 0.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = median( PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/test/test.native.js index 5f8776f4b2c3..ec778890e6e3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/median/test/test.native.js @@ -51,13 +51,13 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) { var v = median( NaN, 0.5 ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = median( 10, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = median( NaN, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -66,16 +66,16 @@ tape( 'if provided a nonpositive `gamma`, the function always returns `NaN`', op var y; y = median( 0.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = median( 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = median( 0.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = median( PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/benchmark/benchmark.js index fcfe05558435..b32ad0f72c8a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/benchmark/benchmark.js @@ -21,8 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -33,22 +32,20 @@ var mode = require( './../lib' ); bench( pkg, function benchmark( b ) { var gamma; - var len; + var opts; var x0; var y; var i; - len = 100; - x0 = new Float64Array( len ); - gamma = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x0[ i ] = uniform( -50.0, 50.0 ); - gamma[ i ] = uniform( EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + x0 = uniform( 100, -50.0, 50.0, opts ); + gamma = uniform( 100, EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = mode( x0[ i % len ], gamma[ i % len ] ); + y = mode( x0[ i % x0.length ], gamma[ i % gamma.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/benchmark/benchmark.native.js index 40c8381b3c1b..3a61de7fd241 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/benchmark/benchmark.native.js @@ -22,9 +22,8 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); var EPS = require( '@stdlib/constants/float64/eps' ); -var uniform = require( '@stdlib/random/base/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; @@ -42,22 +41,20 @@ var opts = { bench( pkg+'::native', opts, function benchmark( b ) { var gamma; - var len; + var opts; var x0; var y; var i; - len = 100; - x0 = new Float64Array( len ); - gamma = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x0[ i ] = uniform( -50.0, 50.0 ); - gamma[ i ] = uniform( EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + x0 = uniform( 100, -50.0, 50.0, opts ); + gamma = uniform( 100, EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = mode( x0[ i % len ], gamma[ i % len ] ); + y = mode( x0[ i % x0.length ], gamma[ i % gamma.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/test/test.js index b7e8b627ec25..0c434cf3be07 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/test/test.js @@ -42,13 +42,13 @@ tape( 'main export is a function', function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { var v = mode( NaN, 0.5 ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = mode( 10.0, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = mode( NaN, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -57,16 +57,16 @@ tape( 'if provided a nonpositive `gamma`, the function always returns `NaN`', fu var y; y = mode( 0.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = mode( 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = mode( 0.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = mode( PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/test/test.native.js index 423a9e0978d3..ed674a1b744d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/mode/test/test.native.js @@ -51,13 +51,13 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) { var v = mode( NaN, 0.5 ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = mode( 10.0, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = mode( NaN, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -66,16 +66,16 @@ tape( 'if provided a nonpositive `gamma`, the function always returns `NaN`', op var y; y = mode( 0.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = mode( 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = mode( 0.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = mode( PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/benchmark/benchmark.js index dd8a36c2b7df..70a1f49af761 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/benchmark/benchmark.js @@ -21,8 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -33,25 +32,22 @@ var pdf = require( './../lib' ); bench( pkg, function benchmark( b ) { var gamma; - var len; + var opts; var x0; var x; var y; var i; - len = 100; - x = new Float64Array( len ); - x0 = new Float64Array( len ); - gamma = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = uniform( -100.0, 0.0 ); - x0[ i ] = uniform( -50.0, 50.0 ); - gamma[ i ] = uniform( EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, -100.0, 0.0, opts ); + x0 = uniform( 100, -50.0, 50.0, opts ); + gamma = uniform( 100, EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = pdf( x[ i % len ], x0[ i % len ], gamma[ i % len ] ); + y = pdf( x[ i % x.length ], x0[ i % x0.length ], gamma[ i % gamma.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } @@ -67,24 +63,24 @@ bench( pkg, function benchmark( b ) { bench( pkg+':factory', function benchmark( b ) { var mypdf; var gamma; - var len; + var opts; var x0; var x; var y; var i; + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, EPS, 100.0, opts ); + x0 = 0.0; gamma = 1.5; mypdf = pdf.factory( x0, gamma ); - len = 100; - x = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = uniform( EPS, 100.0 ); - } b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = mypdf( x[ i % len ] ); + y = mypdf( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/benchmark/benchmark.native.js index a70fe25bccc4..2e86b0a9fce4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/benchmark/benchmark.native.js @@ -22,9 +22,8 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); var EPS = require( '@stdlib/constants/float64/eps' ); -var uniform = require( '@stdlib/random/base/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; @@ -42,25 +41,22 @@ var opts = { bench( pkg+'::native', opts, function benchmark( b ) { var gamma; - var len; + var opts; var x0; var x; var y; var i; - len = 100; - x = new Float64Array( len ); - x0 = new Float64Array( len ); - gamma = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = uniform( -100.0, 0.0 ); - x0[ i ] = uniform( -50.0, 50.0 ); - gamma[ i ] = uniform( EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, -100.0, 0.0, opts ); + x0 = uniform( 100, -50.0, 50.0, opts ); + gamma = uniform( 100, EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = pdf( x[ i % len ], x0[ i % len ], gamma[ i % len ] ); + y = pdf( x[ i % x.length ], x0[ i % x0.length ], gamma[ i % gamma.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.factory.js index 6821f2149a6e..34b14442c7a0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.factory.js @@ -56,23 +56,23 @@ tape( 'if provided `NaN` for any parameter, the created function returns `NaN`', pdf = factory( 0.0, 1.0 ); y = pdf( NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NaN, 1.0 ); y = pdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( 1.0, NaN ); y = pdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NaN, NaN ); y = pdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NaN, NaN ); y = pdf( NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -83,7 +83,7 @@ tape( 'if provided a valid `x0` and `gamma`, the function returns a function whi pdf = factory( 0.0, 1.0 ); y = pdf( PINF ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); t.end(); }); @@ -94,7 +94,7 @@ tape( 'if provided a valid `x0` and `gamma`, the function returns a function whi pdf = factory( 0.0, 1.0 ); y = pdf( NINF ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); t.end(); }); @@ -105,33 +105,33 @@ tape( 'if provided a nonpositive `gamma`, the created function always returns `N pdf = factory( 0.0, 0.0 ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( 0.0, -1.0 ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( 0.0, NINF ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( PINF, NINF ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NINF, NINF ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NaN, NINF ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.native.js index d8778541fdf5..c41300878789 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.native.js @@ -55,38 +55,38 @@ tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, f var y; y = pdf( NaN, 0.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, NaN, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( NaN, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( NaN, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( NaN, NaN, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); tape( 'if provided `+infinity` for `x` and a finite `x0` and `gamma`, the function returns `0`', opts, function test( t ) { var y = pdf( PINF, 0.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); t.end(); }); tape( 'if provided `-infinity` for `x` and a finite `x0` and `gamma`, the function returns `0`', opts, function test( t ) { var y = pdf( NINF, 0.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); t.end(); }); @@ -94,25 +94,25 @@ tape( 'if provided a nonpositive `gamma`, the function always returns `NaN`', op var y; y = pdf( 2.0, 0.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, 0.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.pdf.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.pdf.js index 09ecdc3e542f..cfc2a3653953 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.pdf.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/test/test.pdf.js @@ -46,38 +46,38 @@ tape( 'if provided `NaN` for any parameter, the function returns `NaN`', functio var y; y = pdf( NaN, 0.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, NaN, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( NaN, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( NaN, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( NaN, NaN, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); tape( 'if provided `+infinity` for `x` and a finite `x0` and `gamma`, the function returns `0`', function test( t ) { var y = pdf( PINF, 0.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); t.end(); }); tape( 'if provided `-infinity` for `x` and a finite `x0` and `gamma`, the function returns `0`', function test( t ) { var y = pdf( NINF, 0.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); t.end(); }); @@ -85,25 +85,25 @@ tape( 'if provided a nonpositive `gamma`, the function always returns `NaN`', fu var y; y = pdf( 2.0, 0.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, 0.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/benchmark/benchmark.js index b7a9df4fe4e0..1c2335ac964b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/benchmark/benchmark.js @@ -21,8 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -33,25 +32,22 @@ var quantile = require( './../lib' ); bench( pkg, function benchmark( b ) { var gamma; - var len; + var opts; var x0; var p; var y; var i; - len = 100; - p = new Float64Array( len ); - x0 = new Float64Array( len ); - gamma = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - p[ i ] = uniform( 0.0, 1.0 ); - x0[ i ] = uniform( -50.0, 50.0 ); - gamma[ i ] = uniform( EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + p = uniform( 100, 0.0, 1.0, opts ); + x0 = uniform( 100, -50.0, 50.0, opts ); + gamma = uniform( 100, EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = quantile( p[ i % len ], x0[ i % len ], gamma[ i % len ] ); + y = quantile( p[ i % p.length ], x0[ i % x0.length ], gamma[ i % gamma.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } @@ -67,24 +63,24 @@ bench( pkg, function benchmark( b ) { bench( pkg+':factory', function benchmark( b ) { var myquantile; var gamma; - var len; + var opts; var x0; var p; var y; var i; + opts = { + 'dtype': 'float64' + }; + p = uniform( 100, 0.0, 1.0, opts ); + x0 = 0.0; gamma = 1.5; myquantile = quantile.factory( x0, gamma ); - len = 100; - p = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - p[ i ] = uniform( 0.0, 1.0 ); - } b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = myquantile( p[ i % len ] ); + y = myquantile( p[ i % p.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/test/test.factory.js index e47211cfdee7..81d886936a34 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/test/test.factory.js @@ -56,23 +56,23 @@ tape( 'if provided `NaN` for any parameter, the created function returns `NaN`', quantile = factory( 0.0, 1.0 ); y = quantile( NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NaN, 1.0 ); y = quantile( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( 1.0, NaN ); y = quantile( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NaN, NaN ); y = quantile( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NaN, NaN ); y = quantile( NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -83,10 +83,10 @@ tape( 'if provided a finite `x0` and `gamma`, the function returns a function wh quantile = factory( 0.0, 1.0 ); y = quantile( -0.1 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 1.1 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -97,33 +97,33 @@ tape( 'if provided a nonpositive `gamma`, the created function always returns `N quantile = factory( 0.0, -1.0 ); y = quantile( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( 0.0, 0.0 ); y = quantile( 0.5 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( 0.0, NINF ); y = quantile( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( PINF, NINF ); y = quantile( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NINF, NINF ); y = quantile( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NaN, NINF ); y = quantile( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/test/test.quantile.js b/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/test/test.quantile.js index 6d93cafe626d..ef8947fbbbbd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/test/test.quantile.js +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/quantile/test/test.quantile.js @@ -46,19 +46,19 @@ tape( 'main export is a function', function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { var y = quantile( NaN, 0.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.0, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.0, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); tape( 'if provided a number outside `[0,1]` for `p` and a finite `x0` and `gamma`, the function returns `NaN`', function test( t ) { var y = quantile( PINF, 0.0, 1.0 ); - t.equal( isnan( y ), true, 'returns true' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( PINF, 0.0, 1.0 ); - t.equal( isnan( y ), true, 'returns true' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -66,28 +66,28 @@ tape( 'if provided a nonpositive `gamma`, the function always returns `NaN`', fu var y; y = quantile( 2.0, 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.0, 0.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 2.0, 0.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.0, 0.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 2.0, 0.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 2.0, PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 2.0, NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 2.0, NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); });