Repository navigation
fix: improve accuracy of stats/base/dists/pareto-type1/quantile for small p - #17009
Open
ItsAbir005 wants to merge 2 commits into
Open
ItsAbir005 wants to merge 2 commits into
ItsAbir005 wants to merge 2 commits into
Conversation
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Contributor
Author
|
@kgryte @batpigandme pls review this when get time |
This branch has not been deployed
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 #17008.
Description
This pull request:
beta / pow( 1.0 - p, 1.0 / alpha )withbeta * exp( -log1p( -p ) / alpha )inlib/main.jsandsrc/main.c(andbeta * exp( -log1p( -p ) * alphaInv )inlib/factory.js) to prevent catastrophic cancellation in1.0 - pfor smallp.+Infinity(PINF/STDLIB_CONSTANT_FLOAT64_PINF) whenp === 1.0.manifest.jsondependencies acrossbuild,benchmark, andexamplestasks (@stdlib/math/base/special/exp,@stdlib/math/base/special/log1p,@stdlib/constants/float64/pinf).mpmath-generated small-pfixtures (test/fixtures/python/runner.pyandtest/fixtures/python/small_p.json) and unit tests forp = 0.0,p = 1.0, and smallpintest/test.quantile.js,test/test.factory.js, andtest/test.native.js, while updating existing Julia fixture ULP tolerances (4ULPs forbothLarge/largeAlphaand20ULPs forlargeBeta).Related Issues
This pull request has the following related issues:
stats/base/dists/pareto-type1/quantileloses accuracy for smallp#17008Reference Packages
This pull request followed these packages:
stats/base/dists/rayleigh/quantilestats/base/dists/pareto-type1/meanstats/base/dists/planck/quantilelog1p( -p )to avoid cancellation for small probabilities,STDLIB_CONSTANT_FLOAT64_PINFandmanifest.jsondependency conventions, and the Python fixture script layout (test/fixtures/python/runner.py).beta * exp( -log1p( -p ) / alpha )(and-log1p( -p ) * alphaInvinfactory.js), and adjusting ULP tolerances on the existing Julia-generated fixtures to account for up to 2–17 ULP differences from Julia'spow( 1 - p, ... )evaluation.Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
AI assistance (Gemini) was used to scan for numerical cancellation bugs, implement the
exp/log1pfix across JS and C, generate thempmathsmall-ptest fixtures, and update the test suites. All changes and tests were reviewed and verified in Codespaces.@stdlib-js/reviewers