Conversation
Replace the relative tolerance (`EPS`-based) assertions in `test/test.js` and `test/test.native.js` with ULP difference assertions using `@stdlib/assert/is-almost-same-value`. The maximum observed ULP difference across the full 1000-value Julia fixture set is 1 for both the JavaScript and the native C implementation, so both files use a bound of 1 ULP. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D74AN8LAoh4Bg1iYcc83dj
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Member
|
An automated check found potentially unrelated issue/PR references in this PR:
Why this matters: GitHub automatically closes issues referenced with What to do:
This assessment was generated by an AI model and is informational only. Generated by Claude Code |
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/uniform/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, replacing them with a singlet.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );assertion.1in bothtest/test.jsandtest/test.native.js.1for both the JavaScript and the native C implementation.1is therefore the tightest bound possible: at0, 401 of the 1000 fixture assertions fail in each test file (worst casea = 5.6401776468072224,b = 8.157518985003108, returning0.7266938496247836versus an expected0.7266938496247837). The ULP difference distribution over the fixture set is 599 values at0ULP and 401 values at1ULP. The previous relative tolerance was1.0 * EPS, which is consistent with a 1 ULP bound.sqrt( 1/12 ) * ( b-a )as a single subtraction followed by a single multiplication by the same constant, so the JavaScript and native implementations return bitwise-identical results for every fixture value (confirmed empirically: the0ULP run fails the identical 401 assertions in both files). Both files therefore use the same bound.test/test.jsandtest/test.native.jseach pass 1008/1008 assertions on both runs.etc/eslint/.eslintrc.tests.js).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 with Claude Code
https://claude.ai/code/session_01D74AN8LAoh4Bg1iYcc83dj
Generated by Claude Code