diff --git a/lib/node_modules/@stdlib/math/base/special/betaincinv/test/test.js b/lib/node_modules/@stdlib/math/base/special/betaincinv/test/test.js index 3d78b662579f..2182ff83b8ad 100644 --- a/lib/node_modules/@stdlib/math/base/special/betaincinv/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/betaincinv/test/test.js @@ -22,10 +22,9 @@ var tape = require( 'tape' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var PINF = require( '@stdlib/constants/float64/pinf' ); var NINF = require( '@stdlib/constants/float64/ninf' ); -var EPS = require( '@stdlib/constants/float64/eps' ); var betaincinv = require( './../lib' ); @@ -121,42 +120,26 @@ tape( 'if provided a nonpositive `b`, the function returns `NaN`', function test tape( 'the function evaluates the inverse of the lower regularized incomplete beta function', function test( t ) { var expected; - var delta; - var tol; var i; var y; expected = lowerRegularized; for ( i = 0; i < x.length; i++ ) { y = betaincinv( x[i], a[i], b[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+'. a: '+a[i]+'. b: '+b[i]+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = 15.0 * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. a: '+a[i]+'. b: '+b[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual(isAlmostSameValue( y, expected[ i ], 24 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the inverse of the upper regularized incomplete beta function', function test( t ) { var expected; - var delta; - var tol; var i; var y; expected = upperRegularized; for ( i = 0; i < x.length; i++ ) { y = betaincinv( x[i], a[i], b[i], true ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+'. a: '+a[i]+'. b: '+b[i]+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = 15.0 * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. a: '+a[i]+'. b: '+b[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual(isAlmostSameValue( y, expected[ i ], 16 ), true, 'returns expected value' ); } t.end(); });