- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 570
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
Bug in log gamma evaluation #10072
Comments
comment:1
as it name says, RealField only deals with real values, not complex values. Paul |
comment:2
Replying to @zimmermann6:
Okay, fair enough - so change that to whatever |
comment:3
what is strange is that the precision is not taken into account:
Paul |
comment:4
Which is why I think it's a bug in Pynac/GiNaC. I am not sure how to check this, though, since |
comment:5
Though the fact that |
comment:6
More mysterious (after MUCH trouble trying to get Ginac to compile on OS X - needed to install CLN, pkg-config, and readline!!!):
|
This comment has been minimized.
This comment has been minimized.
comment:7
And even more perplexing is that
|
comment:8
I don't see how the wrong result is related (if any) to the correct one. The difference in the Paul |
comment:9
Replying to @zimmermann6:
Correct. My comment about the As to the precision, I think there must be something missing in our code, because the Ginac docs state
So maybe we're not taking that into account, though I have no idea how I would do so. |
comment:10
I found the reason of the bug. In
If somebody provides a patch, I will review it. Paul |
Work Issues: easy patch to write |
Attachment: trac_10072-log_gamma.patch.gz |
Author: Flavia Stan |
Changed work issues from easy patch to write to patch to written |
comment:11
This patch should fix the Flavia |
Reviewer: Paul Zimmermann |
Changed work issues from patch to written to none |
comment:12
excellent work, Flavia! Not only it fixes the reported problem, but also now we can get arbitrary Paul |
Merged: sage-4.6.1.alpha0 |
When
log_gamma
is naively numerically evaluated, it seems to be wrong.Pari gives this:
And in Sage's Maxima:
And in ginsh for Ginac 1.5.8:
which is pretty clearly a different branch choice from Maxima and Pari (the complex part is exactly
2*pi
away from Maxima and Pari).The relevant bit of code is
But I'm not sure if this problem is in Pynac or in the Sage complex field.
CC: @burcin @zimmermann6
Component: basic arithmetic
Author: Flavia Stan
Reviewer: Paul Zimmermann
Merged: sage-4.6.1.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/10072
The text was updated successfully, but these errors were encountered: