-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
Substituting numeric one in symbolic expression gives symbolic one #14326
Comments
comment:2
Jeroen, do you have an idea who to include in cc to help isolate this? Paul |
comment:7
Wow, this is weird. Here is a much simpler example.
In fact, even
works. Yuck. Somehow the custom power method is not doing its job when you substitute . But I don't see an obvious place in Ginac where this would get screwed up... Aha.
Because one does get treated differently. Though
so it also has something to do with the coercion that happens in the power method for symbolic expressions. |
comment:8
Okay, I think this might be a bug in Ginac, or possibly in how we use Ginac. In the Ginac definition of automatic rewriting of power::eval, we have
The other rewriting rules are probably harmless, though if
where the Unfortunately, I'm not sure how to monkey-patch Pynac into recognizing this situation, and I certainly don't want to do a catch in the symbolic expression code, that is really the wrong place. Here's hoping someone really intimately familiar with our back-and-forth to Pynac sees an easy fix. |
comment:9
The problem looks similar to #17130, but that's about |
comment:10
do the patches from #17130 solve this ticket? Paul |
comment:11
Dear Karl-Dieter,
please could you ask the Ginac developers if this is a bug in Ginac? Paul |
comment:12
I am really not familiar enough with Ginac proper to do either of these with any technical knowledge, unfortunately. And the Ginac developer(s) are not particularly responsive right now to any but the most informed pieces of information, apparently. If someone can figured out how to replicate this in Ginac that would be great, but again it could be us misusing it, I'm not sure. I would be surprised if #17130 fixed this, based on my experiments above. |
comment:13
Looking at the code snippet from comment:8 only, I don't think this is a bug in Ginac. The intended behavior is just different in Pynac, so we have to patch Pynac. Ginac wants to keep unique reference counted expression objects for expressions that are equal. That is why they return |
comment:14
Replying to @burcin: Thanks for replying!
Of course! That makes perfect sense - once you say it, before it was murky :( What about for the other case, of
so it would seem that if the exponent is not exact, we want the whole thing to be numerical. I guess we could just strip out that simplification completely, but I don't know if that would give us anything useful either. |
consider the following in Sage 5.8:
This is inconsistent with:
and with:
and:
CC: @mezzarobba @burcin
Component: basic arithmetic
Issue created by migration from https://trac.sagemath.org/ticket/14326
The text was updated successfully, but these errors were encountered: