diff --git a/lib/node_modules/@stdlib/math/base/special/asinh/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/asinh/test/test.native.js index 9f9b5388aef4..2dd7e1b22abd 100644 --- a/lib/node_modules/@stdlib/math/base/special/asinh/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/asinh/test/test.native.js @@ -25,10 +25,9 @@ var tape = require( 'tape' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); -var EPS = require( '@stdlib/constants/float64/eps' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var PINF = require( '@stdlib/constants/float64/pinf' ); var NINF = require( '@stdlib/constants/float64/ninf' ); -var abs = require( '@stdlib/math/base/special/abs' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -67,8 +66,6 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function computes the hyperbolic arcsine on the interval `[-1e-308,-1e-300]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -78,21 +75,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[-1e-308,-1 for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[1e-300,1e-308]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -102,21 +91,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[1e-300,1e- for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[-0.8,0.8]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -126,21 +107,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[-0.8,0.8]` for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[-1.0,-0.8]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -150,21 +123,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[-1.0,-0.8] for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[0.8,1.0]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -174,21 +139,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[0.8,1.0]`' for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[-3.0,-1.0]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -198,21 +155,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[-3.0,-1.0] for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[1.0,3.0]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -222,21 +171,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[1.0,3.0]`' for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[3.0,28.0]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -246,21 +187,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[3.0,28.0]` for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[-28.0,-3.0]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -270,21 +203,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[-28.0,-3.0 for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[28.0,100.0]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -294,21 +219,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[28.0,100.0 for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[-100.0,-28.0]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -318,21 +235,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[-100.0,-28 for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[-1e200,-1e208]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -342,21 +251,13 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[-1e200,-1e for ( i = 0; i < x.length; i++ ) { y = asinh( 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 arcsine on the interval `[1e300,1e308]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -366,13 +267,7 @@ tape( 'the function computes the hyperbolic arcsine on the interval `[1e300,1e30 for ( i = 0; i < x.length; i++ ) { y = asinh( 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(); });