From 0cfeaa3865dc37a4d746d21e76ecb6e4fa6c6035 Mon Sep 17 00:00:00 2001 From: Shubham Date: Sat, 11 Apr 2026 09:41:33 +0530 Subject: [PATCH 1/2] test: migrate `math/base/special/erfc` 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/erfc/test/test.js | 45 ++--------- .../base/special/erfc/test/test.native.js | 75 ++++--------------- 2 files changed, 21 insertions(+), 99 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/erfc/test/test.js b/lib/node_modules/@stdlib/math/base/special/erfc/test/test.js index ceb8d19b0c3a..8b216cf7a2d0 100644 --- a/lib/node_modules/@stdlib/math/base/special/erfc/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/erfc/test/test.js @@ -24,8 +24,7 @@ var tape = require( 'tape' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); 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 erfc = require( './../lib' ); @@ -55,8 +54,6 @@ tape( 'main export is a function', function test( t ) { tape( 'the function evaluates the complementary error function for `x` on the interval `[-5,-100]', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -68,9 +65,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in 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(); @@ -78,8 +73,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary error function for `x` on the interval `[5,100]`', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -91,9 +84,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in 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(); @@ -101,8 +92,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary error function for `x` on the interval `[-2.5,-28]`', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -114,9 +103,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in 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(); @@ -124,8 +111,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary error function for `x` on the interval `[2.5,28]`', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -137,9 +122,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in 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(); @@ -147,8 +130,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary error function for `x` on the interval `[-1,-3]`', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -160,9 +141,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in 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(); @@ -170,8 +149,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary error function for `x` on the interval `[1,3]`', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -183,9 +160,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in 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(); @@ -193,8 +168,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary error function for `x` on the interval `[-0.8,-1]`', function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -206,9 +179,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in 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(); diff --git a/lib/node_modules/@stdlib/math/base/special/erfc/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/erfc/test/test.native.js index 549256b345b5..eeeb90ac9f7c 100644 --- a/lib/node_modules/@stdlib/math/base/special/erfc/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/erfc/test/test.native.js @@ -26,8 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); var NINF = require( '@stdlib/constants/float64/ninf' ); var PINF = require( '@stdlib/constants/float64/pinf' ); var tryRequire = require( '@stdlib/utils/try-require' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); // FIXTURES // @@ -64,8 +63,6 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'the function evaluates the complementary 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; @@ -77,9 +74,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( y - expected[ i ] ); - tol = 2.0 * 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(); @@ -87,8 +82,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary 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; @@ -100,9 +93,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( y - expected[ i ] ); - tol = 2.0 * 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(); @@ -110,8 +101,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary error function for `x` on the interval `[-2.5,-28]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -123,9 +112,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( y - expected[ i ] ); - tol = 2.0 * 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(); @@ -133,8 +120,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary error function for `x` on the interval `[2.5,28]`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -146,9 +131,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( y - expected[ i ] ); - tol = 2.0 * 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(); @@ -156,8 +139,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary 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; @@ -169,9 +150,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( y - expected[ i ] ); - tol = 2.0 * 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(); @@ -179,8 +158,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary 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; @@ -192,9 +169,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( y - expected[ i ] ); - tol = 2.0 * 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(); @@ -202,8 +177,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary 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; @@ -215,9 +188,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( y - expected[ i ] ); - tol = 2.0 * 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(); @@ -225,8 +196,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary 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; @@ -238,9 +207,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( y - expected[ i ] ); - tol = 2.0 * 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(); @@ -248,8 +215,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary 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; @@ -261,9 +226,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( y - expected[ i ] ); - tol = 2.0 * 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(); @@ -271,8 +234,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary 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; @@ -284,9 +245,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+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]+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); } } t.end(); @@ -294,8 +253,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary 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; @@ -307,9 +264,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+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]+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); } } t.end(); @@ -317,8 +272,6 @@ tape( 'the function evaluates the complementary error function for `x` on the in tape( 'the function evaluates the complementary error function for subnormal `x`', opts, function test( t ) { var expected; - var delta; - var tol; var x; var y; var i; @@ -330,9 +283,7 @@ tape( 'the function evaluates the complementary error function for subnormal `x` if ( y === expected[i] ) { t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+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]+'. Δ: '+delta+'. tol: '+tol ); + t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); } } t.end(); From b42ac17ae5ac58426590a125324597cf399d1839 Mon Sep 17 00:00:00 2001 From: Shubham Date: Sat, 11 Apr 2026 18:02:00 +0530 Subject: [PATCH 2/2] test: migrate `math/base/special/erfc` 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/erfc/test/test.js | 42 ++--------- .../base/special/erfc/test/test.native.js | 72 ++++--------------- 2 files changed, 19 insertions(+), 95 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/erfc/test/test.js b/lib/node_modules/@stdlib/math/base/special/erfc/test/test.js index 8b216cf7a2d0..d51338008876 100644 --- a/lib/node_modules/@stdlib/math/base/special/erfc/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/erfc/test/test.js @@ -62,11 +62,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = largerNegative.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -81,11 +77,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = largerPositive.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -100,11 +92,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = largeNegative.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -119,11 +107,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = largePositive.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -138,11 +122,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = mediumNegative.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -157,11 +137,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = mediumPositive.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -176,11 +152,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = smallNegative.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/erfc/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/erfc/test/test.native.js index eeeb90ac9f7c..28d1fd039cde 100644 --- a/lib/node_modules/@stdlib/math/base/special/erfc/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/erfc/test/test.native.js @@ -71,11 +71,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = largerNegative.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -90,11 +86,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = largerPositive.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -109,11 +101,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = largeNegative.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -128,11 +116,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = largePositive.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -147,11 +131,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = mediumNegative.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -166,11 +146,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = mediumPositive.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 2 ), true, 'returns expected value' ); } t.end(); }); @@ -185,11 +161,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = smallNegative.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -204,11 +176,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = smallPositive.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 2 ), true, 'returns expected value' ); } t.end(); }); @@ -223,11 +191,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = smaller.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -242,11 +206,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = tinyNegative.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -261,11 +221,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in x = tinyPositive.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); }); @@ -280,11 +236,7 @@ tape( 'the function evaluates the complementary error function for subnormal `x` x = subnormal.x; for ( i = 0; i < x.length; i++ ) { y = erfc( x[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' ); } t.end(); });