From cf0831f79af9e10c01380c82055824c2d8342e3a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 22 Sep 2026 10:25:46 +0000 Subject: [PATCH] test: migrate `stats/incr/mrmse` to ULP-based assertions Replaces the relative tolerance (`EPS`-scaled) assertion in the moving RMSE accumulator test with a ULP-based assertion using `@stdlib/assert/is-almost-same-value`, and drops the now unused `abs` and `EPS` requires. Ref: https://github.com/stdlib-js/stdlib/issues/11352 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01HQgrpZaysJsUnYF5azzXaB --- .../@stdlib/stats/incr/mrmse/test/test.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/mrmse/test/test.js b/lib/node_modules/@stdlib/stats/incr/mrmse/test/test.js index 5445385660a0..e1ec5c87a08e 100644 --- a/lib/node_modules/@stdlib/stats/incr/mrmse/test/test.js +++ b/lib/node_modules/@stdlib/stats/incr/mrmse/test/test.js @@ -21,10 +21,9 @@ // MODULES // var tape = require( 'tape' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); var sqrt = require( '@stdlib/math/base/special/sqrt' ); -var EPS = require( '@stdlib/constants/float64/eps' ); var incrmrmse = require( './../lib' ); @@ -74,10 +73,8 @@ tape( 'the function returns an accumulator function', function test( t ) { tape( 'the accumulator function computes a moving root mean squared error incrementally', function test( t ) { var expected; var actual; - var delta; var data; var acc; - var tol; var N; var i; @@ -102,14 +99,8 @@ tape( 'the accumulator function computes a moving root mean squared error increm sqrt( 154.0/3.0 ) ]; for ( i = 0; i < N; i++ ) { - actual = acc( data[i][0], data[i][1] ); - if ( actual === expected[i] ) { - t.strictEqual( actual, expected[i], 'returns expected value' ); - } else { - delta = abs( expected[i] - actual ); - tol = 1.0 * EPS * abs( expected[i] ); - t.strictEqual( delta <= tol, true, 'within tolerance. Actual: '+actual+'. Expected: '+expected[i]+'. Delta: '+delta+'. Tol: '+tol+'.' ); - } + actual = acc( data[ i ][ 0 ], data[ i ][ 1 ] ); + t.strictEqual( isAlmostSameValue( actual, expected[ i ], 0 ), true, 'returns expected value' ); } t.end(); });