test: migrate math/base/special/gamma-lanczos-sum-expg-scaled to ULP-based assertions - #14336
Merged
Merged
Conversation
…P-based assertions Ref: #11352 Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RxMQy5RCWnbGv3PwexRff1
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/gamma-lanczos-sum-expg-scaledfrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.delta/tolcomputation and they === expectedspecial case intest/test.jsandtest/test.native.jswith a singlet.strictEqual( isAlmostSameValue( y, expected, 12 ), true, 'returns expected value' );assertion.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires and adds@stdlib/assert/is-almost-same-value.ULP bound:
12for bothtest/test.jsandtest/test.native.js.This is the measured minimum. Over the full
linspace( 1.0, 100.0, 500 )fixture set, the worst-case ULP difference is 12, occurring atx = 6.158316633266534, and it is the only point above 11 (the next largest difference in the set is 10). Starting from a high bound and tightening,12passes all 503 assertions and11fails exactly one, for both the JavaScript and the native (C) implementation. Each suite was run twice at the final bound with identical results, so the bound is not sensitive to FMA/arch variation on this machine.The previous tolerance was
10.0 * EPS * abs( expected ), i.e. roughly 40 ULP, so the new bound is strictly tighter than what it replaces.This mirrors the migration already merged for the sibling package
math/base/special/gamma-lanczos-sum(#14031), which settled on the same bound of12.Only the two test files are changed; no source, documentation, or
package.jsonchanges are included.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
Verification performed locally:
make test TESTS_FILTER=".*/math/base/special/gamma-lanczos-sum-expg-scaled/.*"—test/test.js503 passing, 0 failing;test/test.native.js503 passing, 0 failing. Run twice with identical results.test/test.native.jswas exercised against a locally built addon (make install-node-addons NODE_ADDONS_PATTERN="gamma-lanczos-sum-expg-scaled"), so the native assertions ran rather than being skipped.11produced 502 passing / 1 failing, confirming12is the minimum.make lint-javascript-tests TESTS_FILTER=".*/math/base/special/gamma-lanczos-sum-expg-scaled/.*"— clean.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running as an unattended scheduled task. The test migration and the ULP bound search (start high, tighten to the minimum that still passes, then re-run to confirm determinism) were performed by the agent, following the idiom established in already-migrated packages in
math/base/special.@stdlib-js/reviewers
Generated by Claude Code