-
-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong subs in rising_factorial #39406
Comments
@mantepse Can start working on this? |
No need to ask, @harith-hacky03. If you think you can do it, propose a pull request. Do you understand the mathematics behind it? |
@mantepse Can this be happening because gamma(-1) is infinity? To solve this can we just put a condition there that is: if a<0 and b>(-a) only then for gamma to return? |
@mantepse Yes , i understand it , i got some conclusions can you let me know is it correct or anything needs to be changed ? Thank you : ) |
I don't think there is actually a bug here. The basis of the issue is the claim that It might be good to have a function that only applies to integers (which seems to be what was in mind when the issue was raised), and It should be noted that the proposed PR does not actually fix the reported issue: even with the PR applied, Another problem is that I don't think the PR is doing what it should. It adds code for certain cases where
If this formula is going to be used for negative integers, then the documentation would need to be updated to say this. I think this might be a good enhancement, but it's not addressing the original complaint (which I think is invalid). |
I don't like this answer, but I think it is completely correct :-) In fact, I never conciously realised when two expressions are supposed to be equal. I like your definition, even though it is problematic in my case. I was trying to implement transformation of sums into standard hypergeometric form, i.e., each summand is represented as a quotient of products of rising factorials. I then wanted to do a naive check (because I had a bug), which failed, because this representation depends on |
Thanks for your reply. After further thought, I don't think my answer is "completely correct". Although it might be true that there is no "bug" right here, there is certainly a problem. I'm pretty sure that the idea of identifying two symbolic expressions that are equal almost everywhere is stated explicitly as a principle in the documentation of ginac (but I may well be wrong that it's accepted as a general rule). It makes sense, but it can lead to mathematically incorrect results, as you have pointed out here. It is especially problematic when, as in this case, the set of measure 0 happens to contain an important part of the domain. I don't know what to do about this in general, or even in this particular case, because I think it would lead to a mess if we tried to special-case the exceptional set in these situations, but I do not like that symbolic calculations cannot be trusted to be correct everywhere. |
Steps To Reproduce
Expected Behavior
The result should be
rising_factorial(-1, b)
, which is0
only ifb > 1
.Actual Behavior
The result is 0.
Additional Information
#19461
Environment
not relevant
Checklist
The text was updated successfully, but these errors were encountered: