-
-
Notifications
You must be signed in to change notification settings - Fork 517
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
floor/ceil can be very slow at integral values #12121
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:3
Note to self (and others): we can use is_int to decide when we should test for equality. Test (once) the first time there's only one integer in the interval. If you have equality there, you're done. If not, you never will (or won't be able to prove it, anyway) and can carry on. |
comment:4
Apparently is_int is deprecated. |
comment:9
I'm not sure if this should go to this ticket, but the following never returns:
Even |
Branch: u/ajagekar.akshay/Trac12121 |
New commits:
|
Author: Akshay Ajagekar |
Commit: |
Changed commit from |
Changed author from Akshay Ajagekar to none |
Changed branch from u/ajagekar.akshay/Trac12121 to none |
comment:13
Replying to @zimmermann6:
Whereas the following actually works
I think that "very slow" includes "infinite amount of time". For me it is worth it to also fix this kind of endless loops in this ticket. |
comment:14
@sagetrac-ajagekar-akshay: why did you remove your branch? The commit lacks some examples (as the one of comment:9). |
comment:71
You removed the symbolic property of |
comment:72
Please try to fix your code so previous frac doctests work. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:74
Ralf, what do you call the "symbolic property" of On the other hand I have comments about the previous code of
I let the |
comment:76
Replying to @videlec:
Well, of course there will always be examples where the zero-test fails! Above I suggested to try both simplification followed by |
comment:77
Replying to @videlec:
Yes; I thought that was what the comment about |
comment:78
Replying to @mezzarobba:
For me unreliable was "sometimes there are false negative". But it is not only that as there are "false positive". Meaning that
is equally good. |
comment:79
If you have a |
comment:80
Replying to @videlec:
That it can be part of expressions. In the first version of your "fix frac" commit you unconditionally expanded
I do! Marc:
In #16397 I implemented this already in https://github.com/sagemath/sage-prod/blob/master/src/sage/symbolic/comparison.pyx#L291 to have some code usable for |
Work Issues: test failures |
comment:82
A minor suggestion: perhaps make Also, I'm not sure how bad the existing implementation of |
comment:83
Replying to @rwst:
I think I don't follow you, sorry. The code you link to looks like it is intended to sort expressions for printing etc., not to provide reliable mathematical results, isn't it? Besides (but this is starting to be off-topic for this ticket), I'm tempted to think that, for non-relational expressions at least, |
comment:85
See also #22079. |
Changed branch from u/vdelecroix/12121 to u/mmezzarobba/ticket/12121-rebased |
comment:87
I have an implementation fixing |
comment:88
This branch does a whole lot more than fixing |
Reported (in slightly different form) on ask.sagemath.org:
This happens because ceil and floor first try to increase the precision of a coercion of the input argument to a
RealInterval
by 100 bits from 53 to 20000 before finally trying a full_simplify, which succeeds. TheRealInterval
rounds all fail because the interval is always of the form (2 - epsilon, 2 + epsilon) and endpoints have different ceilings.With the branch applied
math.floor
andnumpy.floor
are used directlywhich is distinct from the current Sage behavior
CC: @kcrisman @jdemeyer @pelegm
Component: basic arithmetic
Work Issues: test failures
Author: Vincent Delecroix
Branch/Commit: u/mmezzarobba/ticket/12121-rebased @
1b1a32a
Reviewer: Marc Mezzarobba, Ralf Stephan
Issue created by migration from https://trac.sagemath.org/ticket/12121
The text was updated successfully, but these errors were encountered: