Repository navigation
test: migrate math/base/special/gamma1pm1 to ULP-based assertions - #13994
Merged
Merged
Conversation
Replaces relative tolerance assertions in the `gamma1pm1` fixture loops with `isAlmostSameValue` ULP-based assertions. The ULP bounds are the measured minimums over the full fixture sets: 3 ULP for the small negative fixtures and 2 ULP for the small positive fixtures, for both the JavaScript and native implementations. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L8y1oQRpySabKgjBMumaWs
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Planeshifter
approved these changes
Aug 7, 2026
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/gamma1pm1from relative tolerance (EPS-based) assertions to ULP difference assertions using@stdlib/assert/is-almost-same-value.test/test.jsandtest/test.native.js, removing the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.The ULP bounds were tightened to the measured minimum which still passes over the full fixture sets:
fixtures/cpp/small_negative.json(1000 values)5.0 * EPS * abs( expected )fixtures/cpp/small_positive.json(1000 values)2.0 * EPS * abs( expected )The same bounds apply to both the JavaScript and the native (C) implementations, so
test.jsandtest.native.jsuse identical values.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
Notes on how the bounds were determined and verified:
Nfor whichisAlmostSameValue( actual, expected, N )returnstruewas computed; the bound above is the maximum suchNover the full fixture set.2produces 1 failing assertion, and lowering the small positive bound to1produces 29 failing assertions.make install-node-addons NODE_ADDONS_PATTERN=gamma1pm1) so thattest/test.native.jsactually ran rather than being skipped.make test TESTS_FILTER=".*/math/base/special/gamma1pm1/.*"was run twice at the final bounds, with identical results each time (2691 passing intest.js, 2680 passing intest.native.js, 0 failing).make lint-javascript-tests TESTS_FILTER=".*/math/base/special/gamma1pm1/.*"is clean.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written by Claude Code, following the idiom established in previously merged conversions (e.g.,
math/base/special/sqrt1pm1,math/base/special/asec,math/base/special/powm1). The ULP bounds were measured empirically against the fixture sets rather than guessed.@stdlib-js/reviewers
Generated by Claude Code