From b637ac88308abb8e23f8fd3007c46c93335d195d Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 10 Apr 2026 18:47:01 +0530 Subject: [PATCH 1/2] test: migrate `math/base/special/erf` to ULP base testing --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../math/base/special/erf/test/test.js | 75 ++--------- .../math/base/special/erf/test/test.native.js | 123 ++---------------- 2 files changed, 26 insertions(+), 172 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/erf/test/test.js b/lib/node_modules/@stdlib/math/base/special/erf/test/test.js index 74d5e05db90a..2c7b22de9565 100644 --- a/lib/node_modules/@stdlib/math/base/special/erf/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/erf/test/test.js @@ -26,8 +26,7 @@ var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); var NINF = require( '@stdlib/constants/float64/ninf' ); 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 erf = require( './../lib' ); @@ -57,8 +56,6 @@ tape( 'main export is a function', function test( t ) { tape( 'the function evaluates the error function for `x` on the interval `[-5,-100]', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -67,21 +64,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-5,-1 x = veryLargeNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[5,100]`', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -90,21 +79,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[5,100 x = veryLargePositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[-2.5,-5]`', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -113,21 +94,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-2.5, x = largeNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[2.5,5]`', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -136,21 +109,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[2.5,5 x = largePositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[-1,-3]`', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -159,21 +124,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-1,-3 x = mediumNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[1,3]`', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -182,13 +139,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[1,3]` x = mediumPositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -203,7 +154,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[-0.8, x = smallNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -218,7 +169,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[0.8,1 x = smallPositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -233,7 +184,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[-0.8, x = smaller.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -248,7 +199,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[-1e-3 x = tinyNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -263,7 +214,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[1e-30 x = tinyPositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -278,7 +229,7 @@ tape( 'the function evaluates the error function for subnormal `x`', function te x = subnormal.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/erf/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/erf/test/test.native.js index 117b82caafc1..399e180d2cc9 100644 --- a/lib/node_modules/@stdlib/math/base/special/erf/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/erf/test/test.native.js @@ -27,9 +27,8 @@ var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); var NINF = require( '@stdlib/constants/float64/ninf' ); var PINF = require( '@stdlib/constants/float64/pinf' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var tryRequire = require( '@stdlib/utils/try-require' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var abs = require( '@stdlib/math/base/special/abs' ); // FIXTURES // @@ -66,8 +65,6 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function evaluates the error function for `x` on the interval `[-5,-100]', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -76,21 +73,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-5,-1 x = veryLargeNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[5,100]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -99,21 +88,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[5,100 x = veryLargePositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[-2.5,-5]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -122,21 +103,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-2.5, x = largeNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[2.5,5]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -145,21 +118,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[2.5,5 x = largePositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[-1,-3]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -168,21 +133,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-1,-3 x = mediumNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[1,3]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -191,21 +148,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[1,3]` x = mediumPositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[-0.8,-1]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -214,21 +163,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-0.8, x = smallNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[0.8,1]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -237,21 +178,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[0.8,1 x = smallPositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[-0.8,0.8]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -260,21 +193,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-0.8, x = smaller.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[-1e-300,-1e-308]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -283,21 +208,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-1e-3 x = tinyNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for `x` on the interval `[1e-300,1e-308]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -306,21 +223,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[1e-30 x = tinyPositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); tape( 'the function evaluates the error function for subnormal `x`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -329,13 +238,7 @@ tape( 'the function evaluates the error function for subnormal `x`', opts, funct x = subnormal.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - delta = abs( y - expected[ i ] ); - tol = EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); From c80cc2d216509bccb1ae4715aadd2b03e2f65719 Mon Sep 17 00:00:00 2001 From: Shubham Date: Sat, 11 Apr 2026 09:28:10 +0530 Subject: [PATCH 2/2] test: update test.js --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/math/base/special/erf/test/test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/erf/test/test.js b/lib/node_modules/@stdlib/math/base/special/erf/test/test.js index 2c7b22de9565..b9409bed0091 100644 --- a/lib/node_modules/@stdlib/math/base/special/erf/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/erf/test/test.js @@ -154,7 +154,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[-0.8, x = smallNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); + t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } t.end(); }); @@ -169,7 +169,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[0.8,1 x = smallPositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); + t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } t.end(); }); @@ -184,7 +184,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[-0.8, x = smaller.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); + t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } t.end(); }); @@ -199,7 +199,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[-1e-3 x = tinyNegative.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); + t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } t.end(); }); @@ -214,7 +214,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[1e-30 x = tinyPositive.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); + t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } t.end(); }); @@ -229,7 +229,7 @@ tape( 'the function evaluates the error function for subnormal `x`', function te x = subnormal.x; for ( i = 0; i < x.length; i++ ) { y = erf( x[i] ); - t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); + t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } t.end(); });