test: migrate stats/base/dists/normal/stdev to ULP-based assertions - #15312
Merged
Merged
Conversation
Replace relative tolerance assertions with ULP difference assertions using `@stdlib/assert/is-almost-same-value`. The minimum ULP value which passes over the full fixture set is `0`, as the implementation returns `sigma` exactly. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PK7gs6ZmFDzvRg4bvGECTM
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:
stats/base/dists/normal/stdevfrom relative tolerance (EPS-based) assertions to ULP difference assertions using@stdlib/assert/is-almost-same-value.Details:
test/test.jsandtest/test.native.js.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires, along with thedelta/tolcomputations and they === expected[i]exact-match branch, replacing them with a singlet.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );assertion.0in bothtest/test.jsandtest/test.native.js.0for both the JavaScript and the native C implementation, so0is the tightest bound possible. This is expected, since both implementations returnsigmaunmodified for valid input.test/test.jspasses 1010/1010 assertions and, with the native add-on built locally,test/test.native.jspasses 1011/1011 assertions on both runs.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
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code, which studied previously merged ULP migrations in the same package family, applied the same idiom here, and empirically determined and verified the minimum ULP bound.
@stdlib-js/reviewers
Generated by Claude Code