From 420589830fc6b1733fc051a67221cfde6bbd77eb Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 23 Sep 2026 06:27:20 +0000 Subject: [PATCH] test: migrate `blas/base/wasm/srot` to ULP-based assertions Migrate the tests for `blas/base/wasm/srot` from relative tolerance assertions to ULP difference assertions. The `EPS`/`abs` based `isApprox` helper in `test/test.main.js`, `test/test.ndarray.js`, `test/test.module.main.js`, and `test/test.module.ndarray.js` is replaced with `@stdlib/number/float32/base/assert/is-almost-same-value`, following the idiom already used in `blas/base/wasm/cscal`. Each ULP bound is tightened to the minimum integer which still passes over the full fixture set. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01MxidB8AeFaVEWsPmCsirHK --- 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: skipped - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - 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 --- --- .../blas/base/wasm/srot/test/test.main.js | 45 ++++++--------- .../base/wasm/srot/test/test.module.main.js | 49 +++++++--------- .../wasm/srot/test/test.module.ndarray.js | 57 ++++++++----------- .../blas/base/wasm/srot/test/test.ndarray.js | 57 ++++++++----------- 4 files changed, 86 insertions(+), 122 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.main.js b/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.main.js index 61b92668c0c0..36ac0a457996 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.main.js @@ -23,8 +23,7 @@ var tape = require( 'tape' ); var Float32Array = require( '@stdlib/array/float32' ); var scopy = require( '@stdlib/blas/base/scopy' ); -var EPS = require( '@stdlib/constants/float32/eps' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var srot = require( './../lib' ); @@ -37,22 +36,14 @@ var srot = require( './../lib' ); * @param {Object} t - test object * @param {Collection} actual - actual values * @param {Collection} expected - expected values -* @param {number} rtol - relative tolerance +* @param {NonNegativeInteger} ulp - maximum allowed ULP difference */ -function isApprox( t, actual, expected, rtol ) { - var delta; - var tol; +function isApprox( t, actual, expected, ulp ) { var i; t.strictEqual( actual.length, expected.length, 'returns expected value' ); for ( i = 0; i < expected.length; i++ ) { - if ( actual[ i ] === expected[ i ] ) { - t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' ); - } else { - delta = abs( actual[ i ] - expected[ i ] ); - tol = rtol * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' ); - } + t.strictEqual( isAlmostSameValuef( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); } } @@ -103,8 +94,8 @@ tape( 'the function applies a plane rotation (sx=1, sy=1)', function test( t ) { x = new Float32Array( xbuf ); y = new Float32Array( ybuf ); out = srot.main( N[ i ], x, 1, y, 1, 0.8, 0.6 ); - isApprox( t, x, xe[ i ], 6.0 ); - isApprox( t, y, ye[ i ], 6.0 ); + isApprox( t, x, xe[ i ], 1 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -143,8 +134,8 @@ tape( 'the function applies a plane rotation (sx=2, sy=-2)', function test( t ) x = new Float32Array( xbuf ); y = new Float32Array( ybuf ); out = srot.main( N[ i ], x, 2, y, -2, 0.8, 0.6 ); - isApprox( t, x, xe[ i ], 20.0 ); - isApprox( t, y, ye[ i ], 20.0 ); + isApprox( t, x, xe[ i ], 6 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -183,8 +174,8 @@ tape( 'the function applies a plane rotation (sx=-2, sy=1)', function test( t ) x = new Float32Array( xbuf ); y = new Float32Array( ybuf ); out = srot.main( N[ i ], x, -2, y, 1, 0.8, 0.6 ); - isApprox( t, x, xe[ i ], 20.0 ); - isApprox( t, y, ye[ i ], 20.0 ); + isApprox( t, x, xe[ i ], 6 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -223,8 +214,8 @@ tape( 'the function applies a plane rotation (sx=-1, sy=-2)', function test( t ) x = new Float32Array( xbuf ); y = new Float32Array( ybuf ); out = srot.main( N[ i ], x, -1, y, -2, 0.8, 0.6 ); - isApprox( t, x, xe[ i ], 4.0 ); - isApprox( t, y, ye[ i ], 4.0 ); + isApprox( t, x, xe[ i ], 1 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -256,8 +247,8 @@ tape( 'the function supports an `x` stride', function test( t ) { xe = new Float32Array( [ 4.4, 2.0, 6.6, 4.0, 5.0 ] ); ye = new Float32Array( [ 4.2, 3.8, 8.0, 9.0, 10.0 ] ); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, 1 ); + isApprox( t, y, ye, 1 ); t.end(); }); @@ -364,8 +355,8 @@ tape( 'the function supports negative strides', function test( t ) { xe = new Float32Array( [ 0.9, 0.1, -0.22, 0.8, 0.18, -0.3, -0.02 ] ); ye = new Float32Array( [ 0.64, -1.26, 0.54, 0.2, -0.6, 0.2, 0.8 ] ); - isApprox( t, x, xe, 20.0 ); - isApprox( t, y, ye, 20.0 ); + isApprox( t, x, xe, 6 ); + isApprox( t, y, ye, 1 ); t.end(); }); @@ -400,8 +391,8 @@ tape( 'the function supports complex access patterns', function test( t ) { xe = new Float32Array( [ 0.78, 0.26, -0.5, 0.8, 0.9, -0.3, -0.4 ] ); ye = new Float32Array( [ 0.04, -0.9, 0.18, 0.7, -0.6, 0.2, 0.8 ] ); - isApprox( t, x, xe, 5.0 ); - isApprox( t, y, ye, 5.0 ); + isApprox( t, x, xe, 1 ); + isApprox( t, y, ye, 2 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.module.main.js index 04ba042b3dbe..0a932bc63600 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.module.main.js @@ -25,8 +25,7 @@ var tape = require( 'tape' ); var Memory = require( '@stdlib/wasm/memory' ); var Float32Array = require( '@stdlib/array/float32' ); -var EPS = require( '@stdlib/constants/float32/eps' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var Module = require( './../lib' ).Module; @@ -39,22 +38,14 @@ var Module = require( './../lib' ).Module; * @param {Object} t - test object * @param {Collection} actual - actual values * @param {Collection} expected - expected values -* @param {number} rtol - relative tolerance +* @param {NonNegativeInteger} ulp - maximum allowed ULP difference */ -function isApprox( t, actual, expected, rtol ) { - var delta; - var tol; +function isApprox( t, actual, expected, ulp ) { var i; t.strictEqual( actual.length, expected.length, 'returns expected value' ); for ( i = 0; i < expected.length; i++ ) { - if ( actual[ i ] === expected[ i ] ) { - t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' ); - } else { - delta = abs( actual[ i ] - expected[ i ] ); - tol = rtol * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' ); - } + t.strictEqual( isAlmostSameValuef( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); } } @@ -110,8 +101,8 @@ tape( 'a module instance has a `main` method which applies a plane rotation (sx= actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 6.0 ); - isApprox( t, actualY, ye, 6.0 ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 2 ); t.end(); }); @@ -147,8 +138,8 @@ tape( 'a module instance has a `main` method which applies a plane rotation (sx= actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 20.0 ); - isApprox( t, actualY, ye, 20.0 ); + isApprox( t, actualX, xe, 6 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); @@ -184,8 +175,8 @@ tape( 'a module instance has a `main` method which applies a plane rotation (sx= actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 20.0 ); - isApprox( t, actualY, ye, 20.0 ); + isApprox( t, actualX, xe, 6 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); @@ -221,8 +212,8 @@ tape( 'a module instance has a `main` method which applies a plane rotation (sx= actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 4.0 ); - isApprox( t, actualY, ye, 4.0 ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 2 ); t.end(); }); @@ -270,8 +261,8 @@ tape( 'a module instance has a `main` method which supports an `x` stride', func actualY = new Float32Array( 5 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 6.0 ); - isApprox( t, actualY, ye, 6.0 ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); @@ -319,8 +310,8 @@ tape( 'a module instance has a `main` method which supports a `y` stride', funct actualY = new Float32Array( 5 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 6.0 ); - isApprox( t, actualY, ye, 6.0 ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -441,8 +432,8 @@ tape( 'a module instance has a `main` method which supports negative strides', f actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 20.0 ); - isApprox( t, actualY, ye, 20.0 ); + isApprox( t, actualX, xe, 6 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); @@ -494,8 +485,8 @@ tape( 'a module instance has a `main` method which supports complex access patte actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 6.0 ); - isApprox( t, actualY, ye, 6.0 ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 2 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.module.ndarray.js index 56bea0fb59f0..8715a9d9db0f 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.module.ndarray.js @@ -25,8 +25,7 @@ var tape = require( 'tape' ); var Memory = require( '@stdlib/wasm/memory' ); var Float32Array = require( '@stdlib/array/float32' ); -var EPS = require( '@stdlib/constants/float32/eps' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var Module = require( './../lib' ).Module; @@ -39,22 +38,14 @@ var Module = require( './../lib' ).Module; * @param {Object} t - test object * @param {Collection} actual - actual values * @param {Collection} expected - expected values -* @param {number} rtol - relative tolerance +* @param {NonNegativeInteger} ulp - maximum allowed ULP difference */ -function isApprox( t, actual, expected, rtol ) { - var delta; - var tol; +function isApprox( t, actual, expected, ulp ) { var i; t.strictEqual( actual.length, expected.length, 'returns expected value' ); for ( i = 0; i < expected.length; i++ ) { - if ( actual[ i ] === expected[ i ] ) { - t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' ); - } else { - delta = abs( actual[ i ] - expected[ i ] ); - tol = rtol * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' ); - } + t.strictEqual( isAlmostSameValuef( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); } } @@ -110,8 +101,8 @@ tape( 'a module instance has a `main` method which applies a plane rotation (sx= actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 6.0 ); - isApprox( t, actualY, ye, 6.0 ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 2 ); t.end(); }); @@ -147,8 +138,8 @@ tape( 'a module instance has a `main` method which applies a plane rotation (sx= actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 20.0 ); - isApprox( t, actualY, ye, 20.0 ); + isApprox( t, actualX, xe, 6 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); @@ -184,8 +175,8 @@ tape( 'a module instance has a `main` method which applies a plane rotation (sx= actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 20.0 ); - isApprox( t, actualY, ye, 20.0 ); + isApprox( t, actualX, xe, 6 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); @@ -221,8 +212,8 @@ tape( 'a module instance has a `main` method which applies a plane rotation (sx= actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 4.0 ); - isApprox( t, actualY, ye, 4.0 ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 2 ); t.end(); }); @@ -270,8 +261,8 @@ tape( 'a module instance has a `main` method which supports an `x` stride', func actualY = new Float32Array( 5 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 6.0 ); - isApprox( t, actualY, ye, 6.0 ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); @@ -319,8 +310,8 @@ tape( 'a module instance has a `main` method which supports an `x` offset', func actualY = new Float32Array( 5 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 6.0 ); - isApprox( t, actualY, ye, 6.0 ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); @@ -368,8 +359,8 @@ tape( 'a module instance has a `main` method which supports a `y` stride', funct actualY = new Float32Array( 5 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 6.0 ); - isApprox( t, actualY, ye, 6.0 ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -417,8 +408,8 @@ tape( 'a module instance has a `main` method which supports a `y` offset', funct actualY = new Float32Array( 5 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 6.0 ); - isApprox( t, actualY, ye, 6.0 ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -539,8 +530,8 @@ tape( 'a module instance has a `main` method which supports negative strides', f actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 20.0 ); - isApprox( t, actualY, ye, 20.0 ); + isApprox( t, actualX, xe, 6 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); @@ -592,8 +583,8 @@ tape( 'a module instance has a `main` method which supports complex access patte actualY = new Float32Array( 7 ); mod.read( xp, actualX ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 6.0 ); - isApprox( t, actualY, ye, 6.0 ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 2 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.ndarray.js index 752d9a882bea..5099e96c3087 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/srot/test/test.ndarray.js @@ -23,8 +23,7 @@ var tape = require( 'tape' ); var Float32Array = require( '@stdlib/array/float32' ); var scopy = require( '@stdlib/blas/base/scopy' ).ndarray; -var EPS = require( '@stdlib/constants/float32/eps' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var srot = require( './../lib' ); @@ -37,22 +36,14 @@ var srot = require( './../lib' ); * @param {Object} t - test object * @param {Collection} actual - actual values * @param {Collection} expected - expected values -* @param {number} rtol - relative tolerance +* @param {NonNegativeInteger} ulp - maximum allowed ULP difference */ -function isApprox( t, actual, expected, rtol ) { - var delta; - var tol; +function isApprox( t, actual, expected, ulp ) { var i; t.strictEqual( actual.length, expected.length, 'returns expected value' ); for ( i = 0; i < expected.length; i++ ) { - if ( actual[ i ] === expected[ i ] ) { - t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' ); - } else { - delta = abs( actual[ i ] - expected[ i ] ); - tol = rtol * EPS * abs( expected[ i ] ); - t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' ); - } + t.strictEqual( isAlmostSameValuef( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); } } @@ -108,8 +99,8 @@ tape( 'the function applies a plane rotation (sx=1, sy=1)', function test( t ) { x = new Float32Array( xbuf ); y = new Float32Array( ybuf ); out = srot.ndarray( N[ i ], x, 1, ox[ i ], y, 1, oy[ i ], 0.8, 0.6 ); - isApprox( t, x, xe[ i ], 6.0 ); - isApprox( t, y, ye[ i ], 6.0 ); + isApprox( t, x, xe[ i ], 1 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -153,8 +144,8 @@ tape( 'the function applies a plane rotation (sx=2, sy=-2)', function test( t ) x = new Float32Array( xbuf ); y = new Float32Array( ybuf ); out = srot.ndarray( N[ i ], x, 2, ox[ i ], y, -2, oy[ i ], 0.8, 0.6 ); - isApprox( t, x, xe[ i ], 20.0 ); - isApprox( t, y, ye[ i ], 20.0 ); + isApprox( t, x, xe[ i ], 6 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -197,8 +188,8 @@ tape( 'the function applies a plane rotation (sx=-2, sy=1)', function test( t ) x = new Float32Array( xbuf ); y = new Float32Array( ybuf ); out = srot.ndarray( N[ i ], x, -2, ox[ i ], y, 1, oy[ i ], 0.8, 0.6 ); - isApprox( t, x, xe[ i ], 20.0 ); - isApprox( t, y, ye[ i ], 20.0 ); + isApprox( t, x, xe[ i ], 6 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -242,8 +233,8 @@ tape( 'the function applies a plane rotation (sx=-1, sy=-2)', function test( t ) x = new Float32Array( xbuf ); y = new Float32Array( ybuf ); out = srot.ndarray( N[ i ], x, -1, ox[ i ], y, -2, oy[ i ], 0.8, 0.6 ); - isApprox( t, x, xe[ i ], 4.0 ); - isApprox( t, y, ye[ i ], 4.0 ); + isApprox( t, x, xe[ i ], 1 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -275,8 +266,8 @@ tape( 'the function supports an `x` stride', function test( t ) { xe = new Float32Array( [ 4.4, 2.0, 6.6, 4.0, 5.0 ] ); ye = new Float32Array( [ 4.2, 3.8, 8.0, 9.0, 10.0 ] ); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, 1 ); + isApprox( t, y, ye, 1 ); t.end(); }); @@ -307,8 +298,8 @@ tape( 'the function supports an `x` offset', function test( t ) { xe = new Float32Array( [ 1.0, 5.2, 6.6, 4.0, 5.0 ] ); ye = new Float32Array( [ 3.6, 3.8, 8.0, 9.0, 10.0 ] ); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, 1 ); + isApprox( t, y, ye, 1 ); t.end(); }); @@ -339,8 +330,8 @@ tape( 'the function supports a `y` stride', function test( t ) { xe = new Float32Array( [ -1.0, -3.0, -5.0, 4.0, 5.0 ] ); ye = new Float32Array( [ 1.0, 2.0, 2.0, 4.0, 3.0 ] ); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); t.end(); }); @@ -371,8 +362,8 @@ tape( 'the function supports a `y` offset', function test( t ) { xe = new Float32Array( [ 5.6, 7.0, 3.0, 4.0, 5.0 ] ); ye = new Float32Array( [ 6.0, 7.0, 5.8, 6.0, 10.0 ] ); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, 1 ); + isApprox( t, y, ye, 0 ); t.end(); }); @@ -447,8 +438,8 @@ tape( 'the function supports negative strides', function test( t ) { xe = new Float32Array( [ 0.9, 0.1, -0.22, 0.8, 0.18, -0.3, -0.02 ] ); ye = new Float32Array( [ 0.64, -1.26, 0.54, 0.2, -0.6, 0.2, 0.8 ] ); - isApprox( t, x, xe, 20.0 ); - isApprox( t, y, ye, 20.0 ); + isApprox( t, x, xe, 6 ); + isApprox( t, y, ye, 1 ); t.end(); }); @@ -483,8 +474,8 @@ tape( 'the function supports complex access patterns', function test( t ) { xe = new Float32Array( [ 0.78, 0.26, -0.5, 0.8, 0.9, -0.3, -0.4 ] ); ye = new Float32Array( [ 0.04, -0.9, 0.18, 0.7, -0.6, 0.2, 0.8 ] ); - isApprox( t, x, xe, 5.0 ); - isApprox( t, y, ye, 5.0 ); + isApprox( t, x, xe, 1 ); + isApprox( t, y, ye, 2 ); t.end(); });