Repository navigation
test: migrate stats/base/dists/geometric/entropy to ULP-based assertions - #14674
Merged
Merged
Conversation
…tions Migrate the test suites for `stats/base/dists/geometric/entropy` from relative tolerance (EPS-based) assertions to ULP difference assertions via `@stdlib/assert/is-almost-same-value`. The measured maximum ULP difference over the full fixture set is zero for both the JavaScript and the native implementations, and thus the minimum required ULP value is zero. Ref: #11352
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves a part of #11352.
Description
This pull request:
test/test.jsandtest/test.native.jsofstats/base/dists/geometric/entropyfrom relative tolerance (EPS-based) assertions to ULP difference assertions via@stdlib/assert/is-almost-same-value.delta/toltolerance branch (previouslytol = 1.0 * EPS * abs( expected[ i ] )intest/test.jsandtol = 2.0 * EPS * abs( expected[ i ] )intest/test.native.js) witht.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' ).absandEPSrequires and the correspondingdelta/tolvariable declarations.Final ULP constant:
0, for both test suites (main and native).The bound was tightened empirically. Starting from a high value and searching downward via a per-case minimum-ULP computation over the full fixture set (
test/fixtures/julia/data.json; 1000 fixture cases), the measured maximum ULP difference is0— every fixture value is reproduced bit-for-bit — so0is the minimum value at which the suites pass.Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
No.
Other
test/test.native.jsactually executed rather than being skipped; the native implementation also matches the fixtures exactly (max ULP difference0).test.jsand 1007/1007 intest.native.json both runs.make eslint-tests TESTS_FILTER=".*/stats/base/dists/geometric/entropy/.*"is clean.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This pull request was authored by an automated Claude Code agent running as a scheduled task, following the conventions established in previously merged ULP migration pull requests for this issue.
@stdlib-js/reviewers
Generated by Claude Code