diff --git a/lib/node_modules/@stdlib/math/base/special/acosh/test/test.js b/lib/node_modules/@stdlib/math/base/special/acosh/test/test.js index f441c0f3e90b..2823382e734f 100644 --- a/lib/node_modules/@stdlib/math/base/special/acosh/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/acosh/test/test.js @@ -25,7 +25,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var randu = require( '@stdlib/random/base/randu' ); var EPS = require( '@stdlib/constants/float64/eps' ); var PINF = require( '@stdlib/constants/float64/pinf' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var isPositiveZero = require( '@stdlib/assert/is-positive-zero' ); var acosh = require( './../lib' ); @@ -48,8 +48,6 @@ tape( 'main export is a function', function test( t ) { tape( 'the function computes the hyperbolic arccosine on the interval [1.0,3.0]', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -59,21 +57,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [1.0,3.0]' for ( i = 0; i < x.length; i++ ) { y = acosh( x[i] ); - if ( y === expected[ i ] ) { - t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); - } else { - delta = abs( y - expected[i] ); - tol = 1.0 * EPS * abs( expected[i] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function computes the hyperbolic arccosine on the interval [3.0,28.0]', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -83,21 +73,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [3.0,28.0] for ( i = 0; i < x.length; i++ ) { y = acosh( x[i] ); - if ( y === expected[ i ] ) { - t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); - } else { - delta = abs( y - expected[i] ); - tol = 1.0 * EPS * abs( expected[i] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function computes the hyperbolic arccosine on the interval [28.0,100.0]', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -107,21 +89,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [28.0,100. for ( i = 0; i < x.length; i++ ) { y = acosh( x[i] ); - if ( y === expected[ i ] ) { - t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); - } else { - delta = abs( y - expected[i] ); - tol = 1.0 * EPS * abs( expected[i] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function computes the hyperbolic arccosine for huge values', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -131,13 +105,7 @@ tape( 'the function computes the hyperbolic arccosine for huge values', function for ( i = 0; i < x.length; i++ ) { y = acosh( x[i] ); - if ( y === expected[ i ] ) { - t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); - } else { - delta = abs( y - expected[i] ); - tol = 1.0 * EPS * abs( expected[i] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/acosh/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/acosh/test/test.native.js index e3de12ae6c89..f847905ed8eb 100644 --- a/lib/node_modules/@stdlib/math/base/special/acosh/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/acosh/test/test.native.js @@ -26,7 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var randu = require( '@stdlib/random/base/randu' ); var PINF = require( '@stdlib/constants/float64/pinf' ); var EPS = require( '@stdlib/constants/float64/eps' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var isPositiveZero = require( '@stdlib/assert/is-positive-zero' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -57,8 +57,6 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function computes the hyperbolic arccosine on the interval [1.0,3.0]', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -68,21 +66,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [1.0,3.0]' for ( i = 0; i < x.length; i++ ) { y = acosh( x[i] ); - if ( y === expected[ i ] ) { - t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); - } else { - delta = abs( y - expected[i] ); - tol = 1.0 * EPS * abs( expected[i] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function computes the hyperbolic arccosine on the interval [3.0,28.0]', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -92,21 +82,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [3.0,28.0] for ( i = 0; i < x.length; i++ ) { y = acosh( x[i] ); - if ( y === expected[ i ] ) { - t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); - } else { - delta = abs( y - expected[i] ); - tol = 1.0 * EPS * abs( expected[i] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function computes the hyperbolic arccosine on the interval [28.0,100.0]', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -116,21 +98,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [28.0,100. for ( i = 0; i < x.length; i++ ) { y = acosh( x[i] ); - if ( y === expected[ i ] ) { - t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); - } else { - delta = abs( y - expected[i] ); - tol = 1.0 * EPS * abs( expected[i] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function computes the hyperbolic arccosine for huge values', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -140,13 +114,7 @@ tape( 'the function computes the hyperbolic arccosine for huge values', opts, fu for ( i = 0; i < x.length; i++ ) { y = acosh( x[i] ); - if ( y === expected[ i ] ) { - t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] ); - } else { - delta = abs( y - expected[i] ); - tol = 1.0 * EPS * abs( expected[i] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); });