phobos#10826 address Q1 cases where near origin or near infinity#10890
Merged
thewilsonator merged 4 commits intodlang:stablefrom Nov 5, 2025
Merged
phobos#10826 address Q1 cases where near origin or near infinity#10890thewilsonator merged 4 commits intodlang:stablefrom
thewilsonator merged 4 commits intodlang:stablefrom
Conversation
This modifies the beta function so that it explicitly addresses the case where the input parameters (x,y) are (+0,+0), i.e. next to the origin in the first quadrant. This is already implicitly handled, but explicitly handling it will be make the algoritm clearer when it is extended to address the cases where x is very small and y is very small or very large. Since the cases are numbered, I had to renumber the cases. (Maybe I shouldn't have numbered them originally.)
This adds support for the cases when (x,y) is in the first quadrant and near the origin or the larger of x and y is very large
This changes the NaN handling behavior of beta to be the same as that of the + operator, i.e., when both input arguments are NaN, the one with the larger payload is returned.
Contributor
|
Thanks for your pull request and interest in making D better, @tedgin! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "stable + phobos#10890" |
thewilsonator
approved these changes
Nov 5, 2025
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.
This adds support to
std.mathspecial.beta(x, y)for the cases when (x,y) is in the first quadrant and near the origin, or the larger of x and y is very large. These were missed in the original merge request I made for issue #10826.This also fixes the NaN handling so that it works the same way as
x + y. When bothxandyare NaN, the one with the larger payload is returned.