From 1ee08920f93d039d626dce2ef2014cf3a791bfdf Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 16 Sep 2026 18:14:36 +0000 Subject: [PATCH 1/2] test: migrate `blas/base/wasm/drotm` to ULP-based assertions Ref: https://github.com/stdlib-js/stdlib/issues/11352 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01MMtx9JCXTuSKWSDr6uSzvR --- .../blas/base/wasm/drotm/test/test.main.js | 97 +++++++++------- .../base/wasm/drotm/test/test.module.main.js | 63 ++++++----- .../wasm/drotm/test/test.module.ndarray.js | 75 +++++++------ .../blas/base/wasm/drotm/test/test.ndarray.js | 105 ++++++++++-------- 4 files changed, 188 insertions(+), 152 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.main.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.main.js index 81804fd6276c..7f6df785eff2 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.main.js @@ -22,8 +22,7 @@ var tape = require( 'tape' ); var Float64Array = require( '@stdlib/array/float64' ); -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 drotm = require( './../lib' ); @@ -36,22 +35,14 @@ var drotm = 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( isAlmostSameValue( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); } } @@ -74,6 +65,7 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=1, sy=1)', var xbuf; var ybuf; var out; + var ULP; var xe; var ye; var N; @@ -81,6 +73,7 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=1, sy=1)', var y; var i; + ULP = 2; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -104,8 +97,8 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=1, sy=1)', x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.main( N[ i ], x, 1, y, 1, param ); - isApprox( t, x, xe[ i ], 5.0 ); - isApprox( t, y, ye[ i ], 5.0 ); + isApprox( t, x, xe[ i ], ULP ); + isApprox( t, y, ye[ i ], ULP ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -116,6 +109,7 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=2, sy=-2)' var xbuf; var ybuf; var out; + var ULP; var xe; var ye; var N; @@ -123,6 +117,7 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=2, sy=-2)' var y; var i; + ULP = 1; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -146,8 +141,8 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=2, sy=-2)' x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.main( N[ i ], x, 2, y, -2, param ); - isApprox( t, x, xe[ i ], 10.0 ); - isApprox( t, y, ye[ i ], 10.0 ); + isApprox( t, x, xe[ i ], ULP ); + isApprox( t, y, ye[ i ], ULP ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -158,6 +153,7 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=-2, sy=1)' var xbuf; var ybuf; var out; + var ULP; var xe; var ye; var N; @@ -165,6 +161,7 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=-2, sy=1)' var y; var i; + ULP = 2; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -188,8 +185,8 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=-2, sy=1)' x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.main( N[ i ], x, -2, y, 1, param ); - isApprox( t, x, xe[ i ], 10.0 ); - isApprox( t, y, ye[ i ], 10.0 ); + isApprox( t, x, xe[ i ], ULP ); + isApprox( t, y, ye[ i ], ULP ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -200,6 +197,7 @@ tape( 'the `main` method applies a plane rotation (sx=-1, sy=-2)', function test var xbuf; var ybuf; var out; + var ULP; var xe; var ye; var N; @@ -207,6 +205,7 @@ tape( 'the `main` method applies a plane rotation (sx=-1, sy=-2)', function test var y; var i; + ULP = 1; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -230,8 +229,8 @@ tape( 'the `main` method applies a plane rotation (sx=-1, sy=-2)', function test x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.main( N[ i ], x, -1, y, -2, param ); - isApprox( t, x, xe[ i ], 4.0 ); - isApprox( t, y, ye[ i ], 4.0 ); + isApprox( t, x, xe[ i ], ULP ); + isApprox( t, y, ye[ i ], ULP ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -239,11 +238,13 @@ tape( 'the `main` method applies a plane rotation (sx=-1, sy=-2)', function test tape( 'the `main` method applies a plane rotation', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, @@ -277,8 +278,8 @@ tape( 'the `main` method applies a plane rotation', function test( t ) { 10.0 // 2 ]); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 0 @@ -313,19 +314,21 @@ tape( 'the `main` method applies a plane rotation', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); tape( 'the `main` method supports an `x` stride', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, @@ -359,8 +362,8 @@ tape( 'the `main` method supports an `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 0 @@ -395,19 +398,21 @@ tape( 'the `main` method supports an `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); tape( 'the `main` method supports a negative `x` stride', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 0; x = new Float64Array([ 1.0, // 1 2.0, @@ -441,8 +446,8 @@ tape( 'the `main` method supports a negative `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 2 @@ -477,19 +482,21 @@ tape( 'the `main` method supports a negative `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); tape( 'the `main` method supports a `y` stride', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, // 1 @@ -523,8 +530,8 @@ tape( 'the `main` method supports a `y` stride', function test( t ) { 16.0 // 2 ]); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 0 @@ -559,19 +566,21 @@ tape( 'the `main` method supports a `y` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); tape( 'the `main` method supports a negative `y` stride', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, // 1 @@ -605,8 +614,8 @@ tape( 'the `main` method supports a negative `y` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 0 @@ -641,8 +650,8 @@ tape( 'the `main` method supports a negative `y` stride', function test( t ) { 2.0 // 0 ]); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); @@ -690,11 +699,13 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `main` method tape( 'the `main` method supports complex access patterns', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 1; x = new Float64Array([ 0.6, // 1 0.1, // 0 @@ -720,8 +731,8 @@ tape( 'the `main` method supports complex access patterns', function test( t ) { xe = new Float64Array( [ -0.9, -0.8, -0.5, 0.8, 0.9, -0.3, -0.4 ] ); ye = new Float64Array( [ 1.7, -0.9, 0.5, 0.7, -0.6, 0.2, 0.8 ] ); - isApprox( t, x, xe, 5.0 ); - isApprox( t, y, ye, 5.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.main.js index 8e305a914abb..89dfd8651f9e 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.main.js @@ -25,8 +25,7 @@ var tape = require( 'tape' ); var Memory = require( '@stdlib/wasm/memory' ); var Float64Array = require( '@stdlib/array/float64' ); -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 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( isAlmostSameValue( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); } } @@ -84,12 +75,14 @@ tape( 'a module instance has a `main` method applies a modified Givens plane rot var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 2; mem = new Memory({ 'initial': 1 }); @@ -115,8 +108,8 @@ tape( 'a module instance has a `main` method applies a modified Givens plane rot actualY = new Float64Array( 4 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); // Short datasets: xp = 0; @@ -138,8 +131,8 @@ tape( 'a module instance has a `main` method applies a modified Givens plane rot actualY = new Float64Array( 2 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -149,12 +142,14 @@ tape( 'a module instance has a `main` method applies a modified Givens plane rot var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 1; mem = new Memory({ 'initial': 1 }); @@ -180,8 +175,8 @@ tape( 'a module instance has a `main` method applies a modified Givens plane rot actualY = new Float64Array( 7 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -191,12 +186,14 @@ tape( 'a module instance has a `main` method which supports an `x` stride', func var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -246,8 +243,8 @@ tape( 'a module instance has a `main` method which supports an `x` stride', func actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -257,12 +254,14 @@ tape( 'a module instance has a `main` method which supports a negative `x` strid var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -312,8 +311,8 @@ tape( 'a module instance has a `main` method which supports a negative `x` strid actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -323,12 +322,14 @@ tape( 'a module instance has a `main` method which supports a `y` stride', funct var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -378,8 +379,8 @@ tape( 'a module instance has a `main` method which supports a `y` stride', funct actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -389,12 +390,14 @@ tape( 'a module instance has a `main` method which supports a negative `y` strid var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -444,8 +447,8 @@ tape( 'a module instance has a `main` method which supports a negative `y` strid actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -536,12 +539,14 @@ tape( 'a module instance has a `main` method which supports complex access patte var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 1; mem = new Memory({ 'initial': 1 }); @@ -583,8 +588,8 @@ tape( 'a module instance has a `main` method which supports complex access patte actualY = new Float64Array( 7 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.ndarray.js index 700ee4c91fd6..3564dcfeb2c4 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.ndarray.js @@ -25,8 +25,7 @@ var tape = require( 'tape' ); var Memory = require( '@stdlib/wasm/memory' ); var Float64Array = require( '@stdlib/array/float64' ); -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 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( isAlmostSameValue( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); } } @@ -84,12 +75,14 @@ tape( 'a module instance has an `ndarray` method applies a modified Givens plane var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 2; mem = new Memory({ 'initial': 1 }); @@ -115,8 +108,8 @@ tape( 'a module instance has an `ndarray` method applies a modified Givens plane actualY = new Float64Array( 4 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); // Short datasets: xp = 0; @@ -138,8 +131,8 @@ tape( 'a module instance has an `ndarray` method applies a modified Givens plane actualY = new Float64Array( 2 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -149,12 +142,14 @@ tape( 'a module instance has an `ndarray` method applies a modified Givens plane var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 1; mem = new Memory({ 'initial': 1 }); @@ -180,8 +175,8 @@ tape( 'a module instance has an `ndarray` method applies a modified Givens plane actualY = new Float64Array( 7 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -191,12 +186,14 @@ tape( 'a module instance has an `ndarray` method which supports an `x` stride', var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -246,8 +243,8 @@ tape( 'a module instance has an `ndarray` method which supports an `x` stride', actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -257,12 +254,14 @@ tape( 'a module instance has an `ndarray` method which supports a negative `x` s var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -312,8 +311,8 @@ tape( 'a module instance has an `ndarray` method which supports a negative `x` s actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -323,12 +322,14 @@ tape( 'a module instance has an `ndarray` method which supports an `x` offset', var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -366,8 +367,8 @@ tape( 'a module instance has an `ndarray` method which supports an `x` offset', actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -377,12 +378,14 @@ tape( 'a module instance has an `ndarray` method which supports a `y` stride', f var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -432,8 +435,8 @@ tape( 'a module instance has an `ndarray` method which supports a `y` stride', f actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -443,12 +446,14 @@ tape( 'a module instance has an `ndarray` method which supports a negative `y` s var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -498,8 +503,8 @@ tape( 'a module instance has an `ndarray` method which supports a negative `y` s actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -509,12 +514,14 @@ tape( 'a module instance has an `ndarray` method which supports a `y` offset', f var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -552,8 +559,8 @@ tape( 'a module instance has an `ndarray` method which supports a `y` offset', f actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); @@ -644,12 +651,14 @@ tape( 'a module instance has an `ndarray` method which supports complex access p var actualY; var mem; var mod; + var ULP; var pp; var xe; var ye; var xp; var yp; + ULP = 1; mem = new Memory({ 'initial': 1 }); @@ -691,8 +700,8 @@ tape( 'a module instance has an `ndarray` method which supports complex access p actualY = new Float64Array( 7 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, 2.0 ); - isApprox( t, actualY, ye, 2.0 ); + isApprox( t, actualX, xe, ULP ); + isApprox( t, actualY, ye, ULP ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.ndarray.js index aee754876b2d..b18490451317 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.ndarray.js @@ -22,8 +22,7 @@ var tape = require( 'tape' ); var Float64Array = require( '@stdlib/array/float64' ); -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 drotm = require( './../lib' ); @@ -36,22 +35,14 @@ var drotm = 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( isAlmostSameValue( actual[ i ], expected[ i ], ulp ), true, 'returns expected value' ); } } @@ -74,6 +65,7 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=1, sy=1 var xbuf; var ybuf; var out; + var ULP; var ox; var oy; var xe; @@ -83,6 +75,7 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=1, sy=1 var y; var i; + ULP = 2; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -110,8 +103,8 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=1, sy=1 x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.ndarray( N[ i ], x, 1, ox[ i ], y, 1, oy[ i ], param ); - isApprox( t, x, xe[ i ], 5.0 ); - isApprox( t, y, ye[ i ], 5.0 ); + isApprox( t, x, xe[ i ], ULP ); + isApprox( t, y, ye[ i ], ULP ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -122,6 +115,7 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=2, sy=- var xbuf; var ybuf; var out; + var ULP; var ox; var oy; var xe; @@ -131,6 +125,7 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=2, sy=- var y; var i; + ULP = 1; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -158,8 +153,8 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=2, sy=- x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.ndarray( N[ i ], x, 2, ox[ i ], y, -2, oy[ i ], param ); - isApprox( t, x, xe[ i ], 10.0 ); - isApprox( t, y, ye[ i ], 10.0 ); + isApprox( t, x, xe[ i ], ULP ); + isApprox( t, y, ye[ i ], ULP ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -170,6 +165,7 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=-2, sy= var xbuf; var ybuf; var out; + var ULP; var ox; var oy; var xe; @@ -179,6 +175,7 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=-2, sy= var y; var i; + ULP = 2; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -206,8 +203,8 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=-2, sy= x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.ndarray( N[ i ], x, -2, ox[ i ], y, 1, oy[ i ], param ); - isApprox( t, x, xe[ i ], 10.0 ); - isApprox( t, y, ye[ i ], 10.0 ); + isApprox( t, x, xe[ i ], ULP ); + isApprox( t, y, ye[ i ], ULP ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -218,6 +215,7 @@ tape( 'the `ndarray` method applies a plane rotation (sx=-1, sy=-2)', function t var xbuf; var ybuf; var out; + var ULP; var ox; var oy; var xe; @@ -227,6 +225,7 @@ tape( 'the `ndarray` method applies a plane rotation (sx=-1, sy=-2)', function t var y; var i; + ULP = 1; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -254,8 +253,8 @@ tape( 'the `ndarray` method applies a plane rotation (sx=-1, sy=-2)', function t x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.ndarray( N[ i ], x, -1, ox[ i ], y, -2, oy[ i ], param ); - isApprox( t, x, xe[ i ], 4.0 ); - isApprox( t, y, ye[ i ], 4.0 ); + isApprox( t, x, xe[ i ], ULP ); + isApprox( t, y, ye[ i ], ULP ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -263,11 +262,13 @@ tape( 'the `ndarray` method applies a plane rotation (sx=-1, sy=-2)', function t tape( 'the `ndarray` method applies a plane rotation', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, @@ -301,8 +302,8 @@ tape( 'the `ndarray` method applies a plane rotation', function test( t ) { 10.0 // 2 ]); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 0 @@ -337,19 +338,21 @@ tape( 'the `ndarray` method applies a plane rotation', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); tape( 'the `ndarray` method supports an `x` stride', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, @@ -384,8 +387,8 @@ tape( 'the `ndarray` method supports an `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 0 @@ -420,19 +423,21 @@ tape( 'the `ndarray` method supports an `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); tape( 'the `ndarray` method supports an `x` offset', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 0; x = new Float64Array([ 1.0, 2.0, // 0 @@ -455,8 +460,8 @@ tape( 'the `ndarray` method supports an `x` offset', function test( t ) { xe = new Float64Array( [ 1.0, -16.0, -21.0, 4.0, 5.0 ] ); ye = new Float64Array( [ 10.0, 7.0, 14.0, 9.0, 10.0 ] ); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 1 @@ -491,8 +496,8 @@ tape( 'the `ndarray` method supports an `x` offset', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 2 @@ -527,19 +532,21 @@ tape( 'the `ndarray` method supports an `x` offset', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); tape( 'the `ndarray` method supports a `y` stride', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, // 1 @@ -573,8 +580,8 @@ tape( 'the `ndarray` method supports a `y` stride', function test( t ) { 16.0 // 2 ]); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 0 @@ -609,19 +616,21 @@ tape( 'the `ndarray` method supports a `y` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 1.0 ); - isApprox( t, y, ye, 1.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); tape( 'the `ndarray` method supports a `y` offset', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, // 1 @@ -644,8 +653,8 @@ tape( 'the `ndarray` method supports a `y` offset', function test( t ) { xe = new Float64Array( [ -20.0, -25.0, 3.0, 4.0, 5.0 ] ); ye = new Float64Array( [ 6.0, 9.0, 8.0, 13.0, 10.0 ] ); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 0 @@ -680,8 +689,8 @@ tape( 'the `ndarray` method supports a `y` offset', function test( t ) { 10.0 ]); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); x = new Float64Array([ 1.0, // 0 @@ -716,8 +725,8 @@ tape( 'the `ndarray` method supports a `y` offset', function test( t ) { 2.0 // 0 ]); - isApprox( t, x, xe, 2.0 ); - isApprox( t, y, ye, 2.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); @@ -765,11 +774,13 @@ tape( 'if provided an `N` parameter less than or equal to `0`, a module instance tape( 'the `ndarray` method supports complex access patterns', function test( t ) { var param; + var ULP; var xe; var ye; var x; var y; + ULP = 1; x = new Float64Array([ 0.6, // 1 0.1, // 0 @@ -795,8 +806,8 @@ tape( 'the `ndarray` method supports complex access patterns', function test( t xe = new Float64Array( [ -0.9, -0.8, -0.5, 0.8, 0.9, -0.3, -0.4 ] ); ye = new Float64Array( [ 1.7, -0.9, 0.5, 0.7, -0.6, 0.2, 0.8 ] ); - isApprox( t, x, xe, 5.0 ); - isApprox( t, y, ye, 5.0 ); + isApprox( t, x, xe, ULP ); + isApprox( t, y, ye, ULP ); t.end(); }); From b012af0b84cf8e91295f42d6c584301f48591bcb Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Tue, 22 Sep 2026 00:04:39 -0500 Subject: [PATCH 2/2] style: inline ULP values per call site Co-Authored-By: Claude Opus 5 (1M context) --- .../blas/base/wasm/drotm/test/test.main.js | 80 +++++++---------- .../base/wasm/drotm/test/test.module.main.js | 46 ++++------ .../wasm/drotm/test/test.module.ndarray.js | 58 +++++------- .../blas/base/wasm/drotm/test/test.ndarray.js | 88 +++++++------------ 4 files changed, 100 insertions(+), 172 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.main.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.main.js index 7f6df785eff2..f7fef2bfbf5f 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.main.js @@ -65,7 +65,6 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=1, sy=1)', var xbuf; var ybuf; var out; - var ULP; var xe; var ye; var N; @@ -73,7 +72,6 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=1, sy=1)', var y; var i; - ULP = 2; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -97,8 +95,8 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=1, sy=1)', x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.main( N[ i ], x, 1, y, 1, param ); - isApprox( t, x, xe[ i ], ULP ); - isApprox( t, y, ye[ i ], ULP ); + isApprox( t, x, xe[ i ], 2 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -109,7 +107,6 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=2, sy=-2)' var xbuf; var ybuf; var out; - var ULP; var xe; var ye; var N; @@ -117,7 +114,6 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=2, sy=-2)' var y; var i; - ULP = 1; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -141,8 +137,8 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=2, sy=-2)' x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.main( N[ i ], x, 2, y, -2, param ); - isApprox( t, x, xe[ i ], ULP ); - isApprox( t, y, ye[ i ], ULP ); + isApprox( t, x, xe[ i ], 1 ); + isApprox( t, y, ye[ i ], 1 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -153,7 +149,6 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=-2, sy=1)' var xbuf; var ybuf; var out; - var ULP; var xe; var ye; var N; @@ -161,7 +156,6 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=-2, sy=1)' var y; var i; - ULP = 2; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -185,8 +179,8 @@ tape( 'the `main` method applies a modified Givens plane rotation (sx=-2, sy=1)' x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.main( N[ i ], x, -2, y, 1, param ); - isApprox( t, x, xe[ i ], ULP ); - isApprox( t, y, ye[ i ], ULP ); + isApprox( t, x, xe[ i ], 2 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -197,7 +191,6 @@ tape( 'the `main` method applies a plane rotation (sx=-1, sy=-2)', function test var xbuf; var ybuf; var out; - var ULP; var xe; var ye; var N; @@ -205,7 +198,6 @@ tape( 'the `main` method applies a plane rotation (sx=-1, sy=-2)', function test var y; var i; - ULP = 1; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -229,8 +221,8 @@ tape( 'the `main` method applies a plane rotation (sx=-1, sy=-2)', function test x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.main( N[ i ], x, -1, y, -2, param ); - isApprox( t, x, xe[ i ], ULP ); - isApprox( t, y, ye[ i ], ULP ); + isApprox( t, x, xe[ i ], 1 ); + isApprox( t, y, ye[ i ], 1 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -238,13 +230,11 @@ tape( 'the `main` method applies a plane rotation (sx=-1, sy=-2)', function test tape( 'the `main` method applies a plane rotation', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, @@ -278,8 +268,8 @@ tape( 'the `main` method applies a plane rotation', function test( t ) { 10.0 // 2 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 0 @@ -314,21 +304,19 @@ tape( 'the `main` method applies a plane rotation', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); t.end(); }); tape( 'the `main` method supports an `x` stride', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, @@ -362,8 +350,8 @@ tape( 'the `main` method supports an `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 0 @@ -398,21 +386,19 @@ tape( 'the `main` method supports an `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); t.end(); }); tape( 'the `main` method supports a negative `x` stride', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 0; x = new Float64Array([ 1.0, // 1 2.0, @@ -446,8 +432,8 @@ tape( 'the `main` method supports a negative `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 2 @@ -482,21 +468,19 @@ tape( 'the `main` method supports a negative `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); t.end(); }); tape( 'the `main` method supports a `y` stride', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, // 1 @@ -530,8 +514,8 @@ tape( 'the `main` method supports a `y` stride', function test( t ) { 16.0 // 2 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 0 @@ -566,21 +550,19 @@ tape( 'the `main` method supports a `y` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); t.end(); }); tape( 'the `main` method supports a negative `y` stride', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, // 1 @@ -614,8 +596,8 @@ tape( 'the `main` method supports a negative `y` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 0 @@ -650,8 +632,8 @@ tape( 'the `main` method supports a negative `y` stride', function test( t ) { 2.0 // 0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); t.end(); }); @@ -699,13 +681,11 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `main` method tape( 'the `main` method supports complex access patterns', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 1; x = new Float64Array([ 0.6, // 1 0.1, // 0 @@ -731,8 +711,8 @@ tape( 'the `main` method supports complex access patterns', function test( t ) { xe = new Float64Array( [ -0.9, -0.8, -0.5, 0.8, 0.9, -0.3, -0.4 ] ); ye = new Float64Array( [ 1.7, -0.9, 0.5, 0.7, -0.6, 0.2, 0.8 ] ); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 1 ); + isApprox( t, y, ye, 1 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.main.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.main.js index 89dfd8651f9e..be3a1799c9d1 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.main.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.main.js @@ -75,14 +75,12 @@ tape( 'a module instance has a `main` method applies a modified Givens plane rot var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 2; mem = new Memory({ 'initial': 1 }); @@ -108,8 +106,8 @@ tape( 'a module instance has a `main` method applies a modified Givens plane rot actualY = new Float64Array( 4 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 2 ); + isApprox( t, actualY, ye, 2 ); // Short datasets: xp = 0; @@ -131,8 +129,8 @@ tape( 'a module instance has a `main` method applies a modified Givens plane rot actualY = new Float64Array( 2 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 2 ); + isApprox( t, actualY, ye, 2 ); t.end(); }); @@ -142,14 +140,12 @@ tape( 'a module instance has a `main` method applies a modified Givens plane rot var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 1; mem = new Memory({ 'initial': 1 }); @@ -175,8 +171,8 @@ tape( 'a module instance has a `main` method applies a modified Givens plane rot actualY = new Float64Array( 7 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); @@ -186,14 +182,12 @@ tape( 'a module instance has a `main` method which supports an `x` stride', func var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -243,8 +237,8 @@ tape( 'a module instance has a `main` method which supports an `x` stride', func actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -254,14 +248,12 @@ tape( 'a module instance has a `main` method which supports a negative `x` strid var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -311,8 +303,8 @@ tape( 'a module instance has a `main` method which supports a negative `x` strid actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -322,14 +314,12 @@ tape( 'a module instance has a `main` method which supports a `y` stride', funct var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -379,8 +369,8 @@ tape( 'a module instance has a `main` method which supports a `y` stride', funct actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -390,14 +380,12 @@ tape( 'a module instance has a `main` method which supports a negative `y` strid var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -447,8 +435,8 @@ tape( 'a module instance has a `main` method which supports a negative `y` strid actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -539,14 +527,12 @@ tape( 'a module instance has a `main` method which supports complex access patte var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 1; mem = new Memory({ 'initial': 1 }); @@ -588,8 +574,8 @@ tape( 'a module instance has a `main` method which supports complex access patte actualY = new Float64Array( 7 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.ndarray.js index 3564dcfeb2c4..c5eb99f5ccdd 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.module.ndarray.js @@ -75,14 +75,12 @@ tape( 'a module instance has an `ndarray` method applies a modified Givens plane var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 2; mem = new Memory({ 'initial': 1 }); @@ -108,8 +106,8 @@ tape( 'a module instance has an `ndarray` method applies a modified Givens plane actualY = new Float64Array( 4 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 2 ); + isApprox( t, actualY, ye, 2 ); // Short datasets: xp = 0; @@ -131,8 +129,8 @@ tape( 'a module instance has an `ndarray` method applies a modified Givens plane actualY = new Float64Array( 2 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 2 ); + isApprox( t, actualY, ye, 2 ); t.end(); }); @@ -142,14 +140,12 @@ tape( 'a module instance has an `ndarray` method applies a modified Givens plane var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 1; mem = new Memory({ 'initial': 1 }); @@ -175,8 +171,8 @@ tape( 'a module instance has an `ndarray` method applies a modified Givens plane actualY = new Float64Array( 7 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); @@ -186,14 +182,12 @@ tape( 'a module instance has an `ndarray` method which supports an `x` stride', var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -243,8 +237,8 @@ tape( 'a module instance has an `ndarray` method which supports an `x` stride', actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -254,14 +248,12 @@ tape( 'a module instance has an `ndarray` method which supports a negative `x` s var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -311,8 +303,8 @@ tape( 'a module instance has an `ndarray` method which supports a negative `x` s actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -322,14 +314,12 @@ tape( 'a module instance has an `ndarray` method which supports an `x` offset', var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -367,8 +357,8 @@ tape( 'a module instance has an `ndarray` method which supports an `x` offset', actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -378,14 +368,12 @@ tape( 'a module instance has an `ndarray` method which supports a `y` stride', f var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -435,8 +423,8 @@ tape( 'a module instance has an `ndarray` method which supports a `y` stride', f actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -446,14 +434,12 @@ tape( 'a module instance has an `ndarray` method which supports a negative `y` s var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -503,8 +489,8 @@ tape( 'a module instance has an `ndarray` method which supports a negative `y` s actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -514,14 +500,12 @@ tape( 'a module instance has an `ndarray` method which supports a `y` offset', f var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 0; mem = new Memory({ 'initial': 1 }); @@ -559,8 +543,8 @@ tape( 'a module instance has an `ndarray` method which supports a `y` offset', f actualY = new Float64Array( 5 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 0 ); + isApprox( t, actualY, ye, 0 ); t.end(); }); @@ -651,14 +635,12 @@ tape( 'a module instance has an `ndarray` method which supports complex access p var actualY; var mem; var mod; - var ULP; var pp; var xe; var ye; var xp; var yp; - ULP = 1; mem = new Memory({ 'initial': 1 }); @@ -700,8 +682,8 @@ tape( 'a module instance has an `ndarray` method which supports complex access p actualY = new Float64Array( 7 ); mod.read( yp, actualY ); - isApprox( t, actualX, xe, ULP ); - isApprox( t, actualY, ye, ULP ); + isApprox( t, actualX, xe, 1 ); + isApprox( t, actualY, ye, 1 ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.ndarray.js index b18490451317..b1ce3d256c81 100644 --- a/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/wasm/drotm/test/test.ndarray.js @@ -65,7 +65,6 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=1, sy=1 var xbuf; var ybuf; var out; - var ULP; var ox; var oy; var xe; @@ -75,7 +74,6 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=1, sy=1 var y; var i; - ULP = 2; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -103,8 +101,8 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=1, sy=1 x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.ndarray( N[ i ], x, 1, ox[ i ], y, 1, oy[ i ], param ); - isApprox( t, x, xe[ i ], ULP ); - isApprox( t, y, ye[ i ], ULP ); + isApprox( t, x, xe[ i ], 2 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -115,7 +113,6 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=2, sy=- var xbuf; var ybuf; var out; - var ULP; var ox; var oy; var xe; @@ -125,7 +122,6 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=2, sy=- var y; var i; - ULP = 1; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -153,8 +149,8 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=2, sy=- x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.ndarray( N[ i ], x, 2, ox[ i ], y, -2, oy[ i ], param ); - isApprox( t, x, xe[ i ], ULP ); - isApprox( t, y, ye[ i ], ULP ); + isApprox( t, x, xe[ i ], 1 ); + isApprox( t, y, ye[ i ], 1 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -165,7 +161,6 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=-2, sy= var xbuf; var ybuf; var out; - var ULP; var ox; var oy; var xe; @@ -175,7 +170,6 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=-2, sy= var y; var i; - ULP = 2; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -203,8 +197,8 @@ tape( 'the `ndarray` method applies a modified Givens plane rotation (sx=-2, sy= x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.ndarray( N[ i ], x, -2, ox[ i ], y, 1, oy[ i ], param ); - isApprox( t, x, xe[ i ], ULP ); - isApprox( t, y, ye[ i ], ULP ); + isApprox( t, x, xe[ i ], 2 ); + isApprox( t, y, ye[ i ], 2 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -215,7 +209,6 @@ tape( 'the `ndarray` method applies a plane rotation (sx=-1, sy=-2)', function t var xbuf; var ybuf; var out; - var ULP; var ox; var oy; var xe; @@ -225,7 +218,6 @@ tape( 'the `ndarray` method applies a plane rotation (sx=-1, sy=-2)', function t var y; var i; - ULP = 1; N = [ 0, 1, 2, 4 ]; xbuf = [ 0.6, 0.1, -0.5, 0.8, 0.9, -0.3, -0.4 ]; @@ -253,8 +245,8 @@ tape( 'the `ndarray` method applies a plane rotation (sx=-1, sy=-2)', function t x = new Float64Array( xbuf ); y = new Float64Array( ybuf ); out = drotm.ndarray( N[ i ], x, -1, ox[ i ], y, -2, oy[ i ], param ); - isApprox( t, x, xe[ i ], ULP ); - isApprox( t, y, ye[ i ], ULP ); + isApprox( t, x, xe[ i ], 1 ); + isApprox( t, y, ye[ i ], 1 ); t.strictEqual( out, y, 'returns expected value' ); } t.end(); @@ -262,13 +254,11 @@ tape( 'the `ndarray` method applies a plane rotation (sx=-1, sy=-2)', function t tape( 'the `ndarray` method applies a plane rotation', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, @@ -302,8 +292,8 @@ tape( 'the `ndarray` method applies a plane rotation', function test( t ) { 10.0 // 2 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 0 @@ -338,21 +328,19 @@ tape( 'the `ndarray` method applies a plane rotation', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); t.end(); }); tape( 'the `ndarray` method supports an `x` stride', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, @@ -387,8 +375,8 @@ tape( 'the `ndarray` method supports an `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 0 @@ -423,21 +411,19 @@ tape( 'the `ndarray` method supports an `x` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); t.end(); }); tape( 'the `ndarray` method supports an `x` offset', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 0; x = new Float64Array([ 1.0, 2.0, // 0 @@ -460,8 +446,8 @@ tape( 'the `ndarray` method supports an `x` offset', function test( t ) { xe = new Float64Array( [ 1.0, -16.0, -21.0, 4.0, 5.0 ] ); ye = new Float64Array( [ 10.0, 7.0, 14.0, 9.0, 10.0 ] ); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 1 @@ -496,8 +482,8 @@ tape( 'the `ndarray` method supports an `x` offset', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 2 @@ -532,21 +518,19 @@ tape( 'the `ndarray` method supports an `x` offset', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); t.end(); }); tape( 'the `ndarray` method supports a `y` stride', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, // 1 @@ -580,8 +564,8 @@ tape( 'the `ndarray` method supports a `y` stride', function test( t ) { 16.0 // 2 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 0 @@ -616,21 +600,19 @@ tape( 'the `ndarray` method supports a `y` stride', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); t.end(); }); tape( 'the `ndarray` method supports a `y` offset', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 0; x = new Float64Array([ 1.0, // 0 2.0, // 1 @@ -653,8 +635,8 @@ tape( 'the `ndarray` method supports a `y` offset', function test( t ) { xe = new Float64Array( [ -20.0, -25.0, 3.0, 4.0, 5.0 ] ); ye = new Float64Array( [ 6.0, 9.0, 8.0, 13.0, 10.0 ] ); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 0 @@ -689,8 +671,8 @@ tape( 'the `ndarray` method supports a `y` offset', function test( t ) { 10.0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); x = new Float64Array([ 1.0, // 0 @@ -725,8 +707,8 @@ tape( 'the `ndarray` method supports a `y` offset', function test( t ) { 2.0 // 0 ]); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 0 ); + isApprox( t, y, ye, 0 ); t.end(); }); @@ -774,13 +756,11 @@ tape( 'if provided an `N` parameter less than or equal to `0`, a module instance tape( 'the `ndarray` method supports complex access patterns', function test( t ) { var param; - var ULP; var xe; var ye; var x; var y; - ULP = 1; x = new Float64Array([ 0.6, // 1 0.1, // 0 @@ -806,8 +786,8 @@ tape( 'the `ndarray` method supports complex access patterns', function test( t xe = new Float64Array( [ -0.9, -0.8, -0.5, 0.8, 0.9, -0.3, -0.4 ] ); ye = new Float64Array( [ 1.7, -0.9, 0.5, 0.7, -0.6, 0.2, 0.8 ] ); - isApprox( t, x, xe, ULP ); - isApprox( t, y, ye, ULP ); + isApprox( t, x, xe, 1 ); + isApprox( t, y, ye, 1 ); t.end(); });