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
Recursive call in FractionFieldElement._evaluate_polynomial #25440
Comments
comment:1
What happens here:
|
Branch: u/saraedum/25440 |
Commit: |
comment:3
I had run into a precision problem in the same spot several times before and had never bothered for long enough to track it down. I hope the reviewer doesn't mind that I also fix this while I am at it. New commits:
|
comment:4
I have not run full doctests yet. Let's see what the patchbots think. |
Author: Julian Rüth |
comment:5
The first part looks good to me. (Cc:ing the original author of the code just in case.) Regarding the precision issue, while your fix doesn't hurt as far as I can see, I don't believe |
comment:6
mistake here:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
Replying to @mezzarobba:
I think that's a dilemma of inexact objects and p-adics in particular. Currently, I think there is no good answer here with the operators available in Sage/Python. Whatever you choose, some algorithms are going to break because the assumptions made by the implementation are not met. |
comment:9
Replying to @saraedum:
I'm not so sure: intervals have exactly the same issue, but they only declare equal elements that are, and they work reasonably well with the rest of Sage... Really, for me, the way equality of p-adics (and series) appear to work is closer to a bug than an implementation choice.
Ideally yes, but that's a lost battle.
Probably. Though, if I understand right, (some?) p-adic rings have a maximum precision, and there is an argument for declaring elements equal when they agree to the precision of the parent, or perhaps even to that of the more precise of the two elements. |
comment:10
Replying to @mezzarobba:
It's a valid alternative. Two elements are equal if they are indistinguishable. We have thought about this and it certainly has its merits. But you also have to keep this in mind when implementing generic algorithms. No matter what you do, some assumptions that exact implementations make are going to be violated, e.g., I am not saying that we should not change the notion of equality in p-adics. I have discussed this with several people in the past and even had a ticket about this at some point. However, it's not clear what's the right notion of equality. The one we have is unfortunate but I am not convinced anymore that there is a better one. Anyway, while things are the way they are, I'd like to fix this precision issue in Sage. If you are opposed to this, I don't mind at all to take this out of this changeset and propose it on a different ticket and continue the discussion there :) |
comment:11
Replying to @saraedum:
Yes, of course. And I wholeheartedly agree that Sage is missing finer grained comparison operators. But I thought the (weak) consensus to deal with the situation—not only in the context of intervals, but also, e.g., for method that do their best to answer undecidable questions—was to stick as much as possible to the convention that positive boolean answers must be correct, while negative ones may mean “I don't know”. In any case, that's the convention I try to apply when writing or reviewing generic code where the issue might arise.
No, I don't really care about that particular change, and I'm happy to keep it in if it can help. I just don't think it will be a sustainable model in the long run. |
Reviewer: Marc Mezzarobba |
Changed branch from u/saraedum/25440 to |
comment:13
Replying to @mezzarobba:
And, at #25318, I'm proposing to remove the doctest you added, because it breaks with the changes in that ticket, and I see no way of making things work both with p-adics and with parents that use what I consider the correct semantics for |
Changed commit from |
Currently, the following fails:
CC: @mezzarobba @roed314 @xcaruso @sagetrac-swewers
Component: basic arithmetic
Author: Julian Rüth
Branch:
b773600
Reviewer: Marc Mezzarobba
Issue created by migration from https://trac.sagemath.org/ticket/25440
The text was updated successfully, but these errors were encountered: