test: migrate stats/base/dists/f/pdf to ULP-based assertions - #14853
Draft
aryan7071 wants to merge 1 commit into
Draft
test: migrate stats/base/dists/f/pdf to ULP-based assertions#14853aryan7071 wants to merge 1 commit into
stats/base/dists/f/pdf to ULP-based assertions#14853aryan7071 wants to merge 1 commit into
Conversation
aryan7071
marked this pull request as draft
August 31, 2026 19:08
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 #11352
Description
This pull request:
Each of the six fixture blocks (bothLarge, largeD1, largeD2 each tested against both Julia and Boost C++ reference values) required its own independently-determined minimum ULP bound; a single shared value was not sufficient across all six. Measured minimum ULP bounds:
Each bound is the exact maximum observed ULP difference over its fixture (1000+ cases each), so it is also the minimum bound that passes.
Two of these bounds are notably larger than the rest: both_large/Julia (4003) and large_d2/Boost C++ (1285). Both outlier cases occur at inputs where d1 is very close to 2.0 (d1=2.0068... and d1=2.2371... respectively) — a value this distribution already treats as a special boundary elsewhere in the test suite (the pdf has a removable discontinuity in its limiting behavior at d1=2, per the existing d1<2.0/d1=2.0/d1>2.0 boundary tests). Inspecting these two cases directly shows actual and expected values still agree closely in absolute/relative terms; the outsized ULP counts reflect the fine representable spacing of floating-point values in this region rather than a correctness issue.
The pre-existing "baseline case" test in test.native.js (a single hardcoded input/output check, unrelated to the six fixture-driven blocks above) already used isAlmostSameValue with ULP=2 prior to this PR and was not modified.
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
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers