Repository navigation
test: migrate stats/base/dists/betaprime/logpdf to ULP-based assertions - #15736
Merged
Merged
Conversation
…ions Replace the relative tolerance comparisons in the fixture loops with `@stdlib/assert/is-almost-same-value` checks. The ULP bounds are the measured minimums for each fixture set (32768 for `both_large`, 384 for `large_alpha`, and 8192 for `large_beta`), and are identical for the main, factory, and native implementations. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PoVHr24hud4A2KStzaRMPX
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:
stats/base/dists/betaprime/logpdffrom relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.The computed
delta/tolcomparisons in the fixture loops oftest/test.logpdf.js,test/test.factory.js, andtest/test.native.jsare replaced withisAlmostSameValue( y, expected[ i ], <ulp> )assertions, and the now-unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires are dropped in favor of@stdlib/assert/is-almost-same-value. No other test cases were touched; the exact comparisons elsewhere in these files are unchanged.The ULP bounds are the measured minimums over each full fixture set (bisected per fixture file, and confirmed by observing a failure at
N-1):fixtures/julia/both_large.jsonfixtures/julia/large_alpha.jsonfixtures/julia/large_beta.jsonThe same three minimums hold for all three implementations under test (
lib/main.js,lib/factory.js, andlib/native.js), sotest.native.jsuses the same bounds astest.logpdf.js. The suite was run twice at the final bounds, with identical results both times (3023 + 3 + 3020 + 3020 assertions passing, native addon built locally so thattest.native.jswas not skipped).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 lint-javascript-tests TESTS_FILTER=".*/stats/base/dists/betaprime/logpdf/.*"is clean.stats/base/dists/betaprime/logcdfandstats/base/dists/beta/logpdf.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written by Claude Code, which also measured the minimum ULP bounds empirically and ran the tests and linter.
@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_01PoVHr24hud4A2KStzaRMPX