test: migrate stats/base/dists/erlang/pdf to ULP-based assertions - #14787
Draft
kgryte wants to merge 1 commit into
Draft
test: migrate stats/base/dists/erlang/pdf to ULP-based assertions#14787kgryte wants to merge 1 commit into
stats/base/dists/erlang/pdf to ULP-based assertions#14787kgryte wants to merge 1 commit into
Conversation
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/erlang/pdffrom relative tolerance testing to ULP difference testing.Specifically,
test/test.pdf.jsandtest/test.factory.jsare updated to replace thedelta/tolcomputation with@stdlib/assert/is-almost-same-value, and the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires are removed. The package has no C implementation, so there is notest/test.native.jsto update, andtest/test.jscontains no tolerance-based assertions.Three Julia fixtures are exercised (1000 cases each), and each is given its own bound, which is the measured minimum over that fixture:
both_large.json180.0 * EPS * abs( expected[ i ] )x = 4.522887156354011,k = 11,lambda = 29.25588256202781large_shape.json90.0 * EPS * abs( expected[ i ] )x = 0.0012734228532729208,k = 10,lambda = 5.668294773024138large_rate.json100.0 * EPS * abs( expected[ i ] )x = 3.805558533887737,k = 7,lambda = 18.90381811016824The bounds are identical for
main.jsandfactory.js, as the latter delegates to the same code path.Each bound was tightened from a high starting value down to the smallest integer which still passes over the full fixture set. At one ULP lower (
270/153/145), exactly one assertion fails per fixture, confirming the bounds are minimal. The suite was run twice at the final bounds to confirm the result is deterministic.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 test files are modified; no source, documentation, or benchmark files are touched.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code as part of an automated conversion task. The migration mirrors the idiom established in previously merged conversions (e.g.
stats/base/dists/halfnormal/logpdf,stats/base/dists/triangular/pdf), and each ULP bound was determined empirically by measuring the per-fixture ULP difference and verifying that the next smaller bound fails.@stdlib-js/reviewers
Generated by Claude Code