diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/README.md index c9ae1efa989a..11b37faa4c87 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/pdf/README.md @@ -223,7 +223,7 @@ int main( void ) { for ( i = 0; i < 25; i++ ) { x = random_uniform( 0.0, 10.0 ); x0 = random_uniform( -5.0, 5.0 ); - gamma = random_uniform( 0.0, 20.0 ) + STDLIB_CONSTANT_FLOAT64_EPS; + gamma = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 ); y = stdlib_base_dists_cauchy_pdf( x, x0, gamma ); printf( "x: %lf, k: %lf, γ: %lf, f(x;x0,γ): %lf\n", x, x0, gamma, y ); } 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 f76ff7578c6f..d8778541fdf5 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 @@ -24,10 +24,8 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); var tryRequire = require( '@stdlib/utils/try-require' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); var PINF = require( '@stdlib/constants/float64/pinf' ); var NINF = require( '@stdlib/constants/float64/ninf' ); -var EPS = require( '@stdlib/constants/float64/eps' ); // FIXTURES // @@ -121,9 +119,7 @@ tape( 'if provided a nonpositive `gamma`, the function always returns `NaN`', op tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (large `gamma`)', opts, function test( t ) { var expected; - var delta; var gamma; - var tol; var x0; var x; var y; @@ -135,22 +131,14 @@ tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (large `gam gamma = largeGamma.gamma; for ( i = 0; i < x.length; i++ ) { y = pdf( x[i], x0[i], gamma[i] ); - if ( y === expected[i] ) { - t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = 1.0 * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. x0: '+x0[i]+'. gamma: '+gamma[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); - } + t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); } t.end(); }); tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (`x0 < 0`)', opts, function test( t ) { var expected; - var delta; var gamma; - var tol; var x0; var x; var y; @@ -162,22 +150,14 @@ tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (`x0 < 0`)' gamma = negativeMedian.gamma; for ( i = 0; i < x.length; i++ ) { y = pdf( x[i], x0[i], gamma[i] ); - if ( y === expected[i] ) { - t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = 1.0 * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. x0: '+x0[i]+'. gamma: '+gamma[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); - } + t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); } t.end(); }); tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (`x0 > 0`)', opts, function test( t ) { var expected; - var delta; var gamma; - var tol; var x0; var x; var y; @@ -189,13 +169,7 @@ tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (`x0 > 0`)' gamma = positiveMedian.gamma; for ( i = 0; i < x.length; i++ ) { y = pdf( x[i], x0[i], gamma[i] ); - if ( y === expected[i] ) { - t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = 1.0 * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. x0: '+x0[i]+'. gamma: '+gamma[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); - } + t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); } 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 02f238c7ddf4..09ecdc3e542f 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 @@ -22,10 +22,8 @@ var tape = require( 'tape' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); var PINF = require( '@stdlib/constants/float64/pinf' ); var NINF = require( '@stdlib/constants/float64/ninf' ); -var EPS = require( '@stdlib/constants/float64/eps' ); var pdf = require( './../lib' ); @@ -112,9 +110,7 @@ tape( 'if provided a nonpositive `gamma`, the function always returns `NaN`', fu tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (large `gamma`)', function test( t ) { var expected; - var delta; var gamma; - var tol; var x0; var x; var y; @@ -126,22 +122,14 @@ tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (large `gam gamma = largeGamma.gamma; for ( i = 0; i < x.length; i++ ) { y = pdf( x[i], x0[i], gamma[i] ); - if ( y === expected[i] ) { - t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = 1.0 * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. x0: '+x0[i]+'. gamma: '+gamma[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); - } + t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); } t.end(); }); tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (`x0 < 0`)', function test( t ) { var expected; - var delta; var gamma; - var tol; var x0; var x; var y; @@ -153,22 +141,14 @@ tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (`x0 < 0`)' gamma = negativeMedian.gamma; for ( i = 0; i < x.length; i++ ) { y = pdf( x[i], x0[i], gamma[i] ); - if ( y === expected[i] ) { - t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = 1.0 * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. x0: '+x0[i]+'. gamma: '+gamma[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); - } + t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); } t.end(); }); tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (`x0 > 0`)', function test( t ) { var expected; - var delta; var gamma; - var tol; var x0; var x; var y; @@ -180,13 +160,7 @@ tape( 'the function evaluates the pdf for `x` given `x0` and `gamma` (`x0 > 0`)' gamma = positiveMedian.gamma; for ( i = 0; i < x.length; i++ ) { y = pdf( x[i], x0[i], gamma[i] ); - if ( y === expected[i] ) { - t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = 1.0 * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. x0: '+x0[i]+'. gamma: '+gamma[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); - } + t.equal( y, expected[i], 'x: '+x[i]+', x0 :'+x0[i]+', gamma: '+gamma[i]+', y: '+y+', expected: '+expected[i] ); } t.end(); });