- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 567
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
New implementation of floor()/ceil() #22079
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
This had nothing to do with arb. The problem is the conversion |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:7
Will hopefully be fixed by the rewrite in progress at #12121. |
comment:8
Replying to @mezzarobba:
... which is still not fixed. I just got hit by this again. Do you have any objections to just remove the "infinite loop" block from |
This comment has been minimized.
This comment has been minimized.
comment:9
Replying to @jdemeyer:
I don't, but maybe you should ask Vincent. (I just rebased his code from #12121 to see how far we are from a solution there, more news on that hopefully after I run the tests!) |
comment:10
I am also working on a proper solution both for this ticket and for #12121. Hang on... |
This comment has been minimized.
This comment has been minimized.
New commits:
|
Commit: |
Author: Jeroen Demeyer |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:33
Do you plan to review this ticket if I fix the conflict? |
comment:34
Yes. It's time to get that done. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:38
Patchbot is green, the documentation looks good. The code is well documented and improves the present implementation. This all represents my minimum criterion to include code in Sage. There are a few things I'd ask you to change/add:
You can set positive after the above changes. If you don't agree with my above criterion however then don't. Finally for a later ticket, one doctest from #12121 cannot be solved. I agree not everything can be solved. This one however would be easy if you had some heuristic to call QQbar on algebraic expressions:
This is still better than current Sage so we should think of a way to limit or predict the effort QQbar is making, e.g. by predicting the degree of the minimal polynomial involved and calling QQbar from |
Reviewer: Ralf Stephan |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:41
conflicts with #22024 |
Changed branch from u/jdemeyer/infinite_loop_in_ceil___function to u/rws/infinite_loop_in_ceil___function |
New commits:
|
Changed branch from u/rws/infinite_loop_in_ceil___function to |
The
ceil
function calls itself if 20000 bits of precision is not enough, which is an obvious infinite loop.and
and
One consequence is that conversion to
int
is also an infinite loop:and
I propose a new implementation of
floor()
andceil()
. The basic idea is to remove the limit on the number of bits and instead put a limit on the number of attempts of computing the floor/ceil. In each attempt, the algorithm tries to determine why computing the floor/ceil did not work.This fixes all issues that I know with the
floor()
/ceil()
algorithm. Of course, the algorithm is still heuristic, so there will always be corner cases that won't work.CC: @videlec @mezzarobba
Component: symbolics
Author: Jeroen Demeyer
Branch/Commit:
8fddcfd
Reviewer: Ralf Stephan
Issue created by migration from https://trac.sagemath.org/ticket/22079
The text was updated successfully, but these errors were encountered: