Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/node_modules/@stdlib/stats/incr/mpcorrdist/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ tape( 'the accumulator function computes a moving sample Pearson product-moment
actual = 0.0; // NOTE: this addresses occasional negative values due to accumulated floating-point error. Based on observation, typically `|actual| ≅ |expected|`, but `actual < 0` and `expected > 0`, suggesting that a sign got "flipped" along the way due to, e.g., operations which theoretically should compute to the same value, but do not due to floating-point error.
}
delta = abs( actual - expected );
if ( expected === 0.0 || actual === 0.0 ) {
tol = 10.0 * EPS;
if ( abs( expected ) < 1.0 ) {
tol = 1.0e6 * EPS;
} else {
tol = 1.0e6 * EPS * abs( expected );
}
Expand Down Expand Up @@ -434,7 +434,11 @@ tape( 'the accumulator function computes a moving sample Pearson product-moment
t.strictEqual( actual, expected, 'returns expected value. dataset: '+i+'. window: '+j+'.' );
} else {
delta = abs( actual - expected );
tol = 1.0e6 * EPS * abs( expected );
if ( abs( expected ) < 1.0 ) {
tol = 1.0e6 * EPS;
} else {
tol = 1.0e6 * EPS * abs( expected );
}
t.strictEqual( delta <= tol, true, 'dataset: '+i+'. window: '+j+'. expected: '+expected+'. actual: '+actual+'. tol: '+tol+'. delta: '+delta+'.' );
}
}
Expand Down