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
round of symbolic expression (precision issue due to RR) #12968
Comments
comment:4
It might be best to do something along the lines of:
but there's the possibility that that addition causes problems with inexact arithmetic. |
Author: Mike Hansen |
comment:5
I've put a patch up which should fix these issues. |
Reviewer: Burcin Erocal |
comment:6
Thanks Mike! This looks great. Just by reading the code, I have one minor problem: Isn't the test |
comment:7
Replying to @burcin:
Maybe you could try converting to RIF first instead and then do the full test if that interval contains zero. Checking to see if there are variables should also be really quick. I'll put up a patch that does this. |
comment:8
I've posted a new patch which should be better. |
This comment has been minimized.
This comment has been minimized.
comment:9
Looks good to me. Patchbot, apply attachment: trac_12968.patch. |
comment:10
This causes a doctest failure (see also the Patchbot):
|
Attachment: trac_12968.patch.gz |
Changed keywords from round symbolic precision RR beginner to round symbolic precision RR beginner, sd40.5 |
comment:11
I've posted a new patch which fixes this issue. If someone could look over it, it's just a matter of changing the doctest. |
comment:12
Yes, this is clearly the same behavior for the error. This test passes now, as do many other relevant ones. |
Changed reviewer from Burcin Erocal to Burcin Erocal, Karl-Dieter Crisman |
comment:13
Just before we put this to bed, I noticed a quirk involving negative numbers. We typically truncate toward zero, like Python:
But our int-ing is a little more sensitive:
|
comment:14
This is due to the default rounding mode for rationals, which is independent of this code. We could make a ticket for changing that, |
comment:15
Yeah, since the behaviour precedes this patch and this patch makes things better, I left it as positive review. If it were a one-line change (i.e. this behaviour wasn't possibly deliberate) we could have done it here, but instead I'll open a new ticket. |
Merged: sage-5.1.beta5 |
We have
Numbers with one digit less work
The docstring/source code of the symbolic round mentions that behavior
This was reported on sage-support by Lorenzo. I created a ticket here, since I didn't find one for that behavior (but maybe I missed it...).
Apply attachment: trac_12968.patch.
CC: @kcrisman @orlitzky
Component: symbolics
Keywords: round symbolic precision RR beginner, sd40.5
Author: Mike Hansen
Reviewer: Burcin Erocal, Karl-Dieter Crisman
Merged: sage-5.1.beta5
Issue created by migration from https://trac.sagemath.org/ticket/12968
The text was updated successfully, but these errors were encountered: