test: migrate math/base/special/asec to ULP-based assertions - #13989
Merged
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0145dbvojq8U5TjsoiKPEbxm
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:
math/base/special/asecfrom relative tolerance comparisons (delta <= tol, wheretol = 1.0 * EPS * abs( expected[i] )) to ULP difference assertions using@stdlib/assert/is-almost-same-value, per the idiom established in [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.@stdlib/constants/float64/epsand@stdlib/math/base/special/absrequires, along with thedelta/tollocals and they === expected[i]exact-match branch, in bothtest/test.jsandtest/test.native.js.The ULP bounds were measured against the full fixture set (4006 fixture values across 8 Julia fixture files) and tightened to the minimum integer which still passes:
medium_negative[-3.0,-1.0]medium_positive[1.0,3.0]large_positive[3.0,100.0]large_negative[-100.0,-3.0]larger_positive[100.0,1000.0]larger_negative[-1000.0,-100.0]huge_negative[-1e200,-1e208]huge_positive[1e300,1e308]The measured maximum ULP difference over each fixture equals the value used, so each bound is minimal (e.g., the
huge_*fixtures are bit-for-bit exact, and lowering any1to0fails). The JavaScript and native C implementations were measured independently and agree exactly, sotest/test.jsandtest/test.native.jsuse identical ULP values. Both suites were run twice at the final values to confirm determinism (4013 assertions passing per file, native add-on built locally).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
Only the two test files are changed; no source, fixture, or documentation changes.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code, which studied the prior conversions in this tracking issue, applied the same idiom to
math/base/special/asec, and measured the minimum ULP bounds empirically against the fixture data.@stdlib-js/reviewers
Generated by Claude Code