diff --git a/lib/node_modules/@stdlib/math/base/special/asech/test/test.js b/lib/node_modules/@stdlib/math/base/special/asech/test/test.js index 10cf7bc9a8cd..a1a0cc71d738 100644 --- a/lib/node_modules/@stdlib/math/base/special/asech/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/asech/test/test.js @@ -21,11 +21,11 @@ // MODULES // var tape = require( 'tape' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); 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 asech = require( './../lib' ); @@ -44,8 +44,6 @@ tape( 'main export is a function', function test( t ) { tape( 'the function computes the hyperbolic arcsecant on the interval (0, 1]', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -55,13 +53,7 @@ tape( 'the function computes the hyperbolic arcsecant on the interval (0, 1]', f for ( i = 0; i < x.length; i++ ) { y = asech( 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/asech/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/asech/test/test.native.js index 351859c4aed9..ed09d5e19f6e 100644 --- a/lib/node_modules/@stdlib/math/base/special/asech/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/asech/test/test.native.js @@ -22,19 +22,14 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); 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 tryRequire = require( '@stdlib/utils/try-require' ); -// FIXTURES // - -var data = require( './fixtures/julia/data.json' ); - - // VARIABLES // var asech = tryRequire( resolve( __dirname, './../lib/native.js' ) ); @@ -43,6 +38,11 @@ var opts = { }; +// FIXTURES // + +var data = require( './fixtures/julia/data.json' ); + + // TESTS // tape( 'main export is a function', opts, function test( t ) { @@ -53,8 +53,6 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function computes the hyperbolic arcsecant on the interval (0, 1]', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -64,13 +62,7 @@ tape( 'the function computes the hyperbolic arcsecant on the interval (0, 1]', o for ( i = 0; i < x.length; i++ ) { y = asech( 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(); });