feat: add stats/base/dists/log-logistic/cdf#11283
feat: add stats/base/dists/log-logistic/cdf#11283parthodas23 wants to merge 1 commit intostdlib-js:developfrom
stats/base/dists/log-logistic/cdf#11283Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
4899765 to
75d869b
Compare
75d869b to
72ff6d2
Compare
72ff6d2 to
c66c194
Compare
|
Hey @parthodas23, pulling this down to review since I am also doing C-ports for distributions. Found a subtle numerical overflow issue in src/main.c around lines 51-52: If x or beta is large enough, xb will overflow to Infinity. In C, calculating Infinity / (1.0 + Infinity) will evaluate to NaN instead of capping at 1.0. You can actually prevent the overflow entirely by inverting the fraction analytically. If you compute it as: Then when x gets huge, alpha / x approaches 0.0, the denominator safely becomes 1.0, and the function returns 1.0 without any overflow or NaN issues. Hope this helps! Happy to review again once you update. |
Resolves none
Description
This pull request:
stats/base/dists/log-logistic/cdfRelated Issues
This pull request has the following related issues:
Questions
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