diff --git a/lib/node_modules/@stdlib/math/base/special/log1mexp/test/test.js b/lib/node_modules/@stdlib/math/base/special/log1mexp/test/test.js index 7adaa6f24e1d..e3f6f8889390 100644 --- a/lib/node_modules/@stdlib/math/base/special/log1mexp/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/log1mexp/test/test.js @@ -21,10 +21,10 @@ // MODULES // var tape = require( 'tape' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var NINF = require( '@stdlib/constants/float64/ninf' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var uniform = require( '@stdlib/random/base/uniform' ); -var abs = require( '@stdlib/math/base/special/abs' ); var exp = require( '@stdlib/math/base/special/exp' ); var expm1 = require( '@stdlib/math/base/special/expm1' ); var EPS = require( '@stdlib/constants/float64/eps' ); @@ -107,8 +107,6 @@ tape( 'the function computes the natural logarithm of `1-exp(-|x|)` (`x > ln(2)` tape( 'the function accurately computes the natural logarithm of `1-exp(-|x|)`', function test( t ) { var actual; - var delta; - var tol; var i; for ( i = 0; i < data.length; i++ ) { @@ -116,9 +114,7 @@ tape( 'the function accurately computes the natural logarithm of `1-exp(-|x|)`', if ( actual === expected[ i ] ) { t.strictEqual( actual, expected[ i ], 'returns '+expected[ i ]+' when provided '+data[ i ] ); } else { - delta = abs( actual - expected[ i ] ); - tol = 100.0 * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+data[ i ]+'. actual: '+actual+'. expected: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); + t.strictEqual( isAlmostSameValue( actual, expected[ i ], 2 ), true, 'returns expected value' ); } } t.end(); diff --git a/lib/node_modules/@stdlib/math/base/special/log1mexp/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/log1mexp/test/test.native.js index 089115135d7f..ba7fc321f363 100644 --- a/lib/node_modules/@stdlib/math/base/special/log1mexp/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/log1mexp/test/test.native.js @@ -22,11 +22,11 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var NINF = require( '@stdlib/constants/float64/ninf' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var uniform = require( '@stdlib/random/base/uniform' ); var tryRequire = require( '@stdlib/utils/try-require' ); -var abs = require( '@stdlib/math/base/special/abs' ); var exp = require( '@stdlib/math/base/special/exp' ); var expm1 = require( '@stdlib/math/base/special/expm1' ); var EPS = require( '@stdlib/constants/float64/eps' ); @@ -76,9 +76,7 @@ tape( 'if provided `+-0`, the function returns -infinity', opts, function test( }); tape( 'the function computes the natural logarithm of `1-exp(-|x|)` (`0 < |x| <= ln(2)`)', opts, function test( t ) { - var delta; var rand; - var tol; var x; var y; var v; @@ -94,18 +92,14 @@ tape( 'the function computes the natural logarithm of `1-exp(-|x|)` (`0 < |x| <= if ( x === y ) { t.strictEqual( x, y, 'returns '+y+' when provided '+v ); } else { - delta = abs( x - y ); - tol = 1.0 * EPS * abs( y ); - t.ok( delta <= tol, 'within tolerance. v: '+v+'. actual: '+x+'. expected: '+y+'. Δ: '+delta+'. tol: '+tol+'.' ); + t.strictEqual( isAlmostSameValue( x, y, 2 ), true, 'returns expected value' ); } } t.end(); }); tape( 'the function computes the natural logarithm of `1-exp(-|x|)` (`x > ln(2)`)', opts, function test( t ) { - var delta; var rand; - var tol; var x; var y; var v; @@ -122,9 +116,7 @@ tape( 'the function computes the natural logarithm of `1-exp(-|x|)` (`x > ln(2)` if ( x === y ) { t.strictEqual( x, y, 'returns '+y+' when provided '+v ); } else { - delta = abs( x - y ); - tol = 1.0 * EPS * abs( y ); - t.ok( delta <= tol, 'within tolerance. v: '+v+'. actual: '+x+'. expected: '+y+'. Δ: '+delta+'. tol: '+tol+'.' ); + t.strictEqual( isAlmostSameValue( x, y, 2 ), true, 'returns expected value' ); } } t.end(); @@ -132,8 +124,6 @@ tape( 'the function computes the natural logarithm of `1-exp(-|x|)` (`x > ln(2)` tape( 'the function accurately computes the natural logarithm of `1-exp(-|x|)`', opts, function test( t ) { var actual; - var delta; - var tol; var i; for ( i = 0; i < data.length; i++ ) { @@ -141,9 +131,7 @@ tape( 'the function accurately computes the natural logarithm of `1-exp(-|x|)`', if ( actual === expected[ i ] ) { t.strictEqual( actual, expected[ i ], 'returns '+expected[ i ]+' when provided '+data[ i ] ); } else { - delta = abs( actual - expected[ i ] ); - tol = 100.0 * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+data[ i ]+'. actual: '+actual+'. expected: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); + t.strictEqual( isAlmostSameValue( actual, expected[ i ], 2 ), true, 'returns expected value' ); } } t.end();