diff --git a/lib/node_modules/@stdlib/math/base/special/acovercosf/test/test.js b/lib/node_modules/@stdlib/math/base/special/acovercosf/test/test.js index e0c0c5308c8f..b5007b1dad6f 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercosf/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/acovercosf/test/test.js @@ -23,9 +23,9 @@ var tape = require( 'tape' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var randu = require( '@stdlib/random/base/randu' ); -var absf = require( '@stdlib/math/base/special/absf' ); var EPS = require( '@stdlib/constants/float32/eps' ); var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +var isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var acovercosf = require( './../lib' ); @@ -45,8 +45,6 @@ tape( 'main export is a function', function test( t ) { tape( 'the function computes the inverse coversed cosine', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -58,21 +56,13 @@ tape( 'the function computes the inverse coversed cosine', function test( t ) { for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); y = acovercosf( x[ i ] ); - if ( y === e ) { - t.strictEqual( y, e, 'x: '+x[ i ]+'. E: '+e ); - } else { - delta = absf( y - e ); - tol = 230.0 * EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y+'. E: '+e+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( isAlmostSameValue( y, e, 234 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function computes the inverse coversed cosine (small positive numbers)', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -84,13 +74,7 @@ tape( 'the function computes the inverse coversed cosine (small positive numbers for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); y = acovercosf( x[ i ] ); - if ( y === e ) { - t.strictEqual( y, e, 'x: '+x[ i ]+'. E: '+e ); - } else { - delta = absf( y - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y+'. E: '+e+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( y, e, 'returns expected value' ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/acovercosf/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/acovercosf/test/test.native.js index de35b9ff2ce0..7c9978b420ac 100644 --- a/lib/node_modules/@stdlib/math/base/special/acovercosf/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/acovercosf/test/test.native.js @@ -24,9 +24,9 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var randu = require( '@stdlib/random/base/randu' ); -var absf = require( '@stdlib/math/base/special/absf' ); var EPS = require( '@stdlib/constants/float32/eps' ); var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +var isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -54,8 +54,6 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function computes the inverse coversed cosine', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -67,21 +65,13 @@ tape( 'the function computes the inverse coversed cosine', opts, function test( for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); y = acovercosf( x[ i ] ); - if ( y === e ) { - t.strictEqual( y, e, 'x: '+x[ i ]+'. E: '+e ); - } else { - delta = absf( y - e ); - tol = 230.0 * EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y+'. E: '+e+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( isAlmostSameValue( y, e, 234 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function computes the inverse coversed cosine (small positive numbers)', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -93,13 +83,7 @@ tape( 'the function computes the inverse coversed cosine (small positive numbers for ( i = 0; i < x.length; i++ ) { e = float64ToFloat32( expected[ i ] ); y = acovercosf( x[ i ] ); - if ( y === e ) { - t.strictEqual( y, e, 'x: '+x[ i ]+'. E: '+e ); - } else { - delta = absf( y - e ); - tol = EPS * absf( e ); - t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y+'. E: '+e+'. tol: '+tol+'. Δ: '+delta+'.' ); - } + t.strictEqual( y, e, 'returns expected value' ); } t.end(); });