Repository navigation
Conversation
Replace the relative tolerance assertion with a ULP difference assertion using `number/float16/base/assert/is-almost-same-value`. Resolves a part of #11352. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KcbsSNKm3CV59rxXUvimhh
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This branch has not been deployed
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:
constants/float16/ln-sqrt-two-pifrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.delta/tolcomparison (absf( v - FLOAT16_LN_SQRT_TWO_PI ) <= EPS * FLOAT16_LN_SQRT_TWO_PI) witht.strictEqual( isAlmostSameValue( v, FLOAT16_LN_SQRT_TWO_PI, 0 ), true, 'returns expected value' ).@stdlib/number/float16/base/assert/is-almost-same-valuerequire and drops the now unused@stdlib/math/base/special/absfand@stdlib/constants/float16/epsrequires.@stdlib/number/float64/base/to-float16before comparison, matching the idiom already used by the converted sibling packages (constants/float16/ln-ten,constants/float16/ln-half,constants/float16/half-ln-two, andconstants/float16/pi-squared).ULP bound:
0.The bound was tightened empirically: starting from a high value and lowering it to the minimum integer which still passes,
float64ToFloat16( lnf( sqrtf( FLOAT16_TWO_PI ) ) )is bit-for-bit equal to the exported constant (measured half-precision ULP difference of0), so0is the minimum required value. The suite was run twice at the final bound to confirm determinism. This also matches the bound used by the already-convertedconstants/float16sibling packages.Only
test/test.jsis changed; no source, documentation, or benchmark files are touched.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
make test TESTS_FILTER=".*/constants/float16/ln-sqrt-two-pi/.*"passes (4/4 assertions), run twice with identical results.make lint-javascript-tests TESTS_FILTER=".*/constants/float16/ln-sqrt-two-pi/.*"is clean.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code, which located the candidate package, mirrored the conversion idiom from the already-converted
constants/float16sibling packages, measured the minimum required ULP bound, and ran the tests and linter.@stdlib-js/reviewers
Generated by Claude Code