Opened 10 years ago
Last modified 7 years ago
#11651 new defect
Decide what to do with e^(y=x)
Reported by: | kcrisman | Owned by: | burcin |
---|---|---|---|
Priority: | minor | Milestone: | sage-6.4 |
Component: | symbolics | Keywords: | maxima parsing |
Cc: | robertwb | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | Reported upstream. Developers deny it's a bug. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
This sage-support thread describes the following problem:
sage: var('y') y sage: (y==x).log() log(y == x) sage: (y==x).log().simplify() # just sends to Maxima and back to Sage log(y) == log(x) sage: (y==x).exp() e^(y == x) sage: (y==x).exp().simplify() # just sends to Maxima and back to Sage TypeError: unable to make sense of Maxima expression 'e^(y=x)' in Sage
Basically, one can consider the problem in two ways - a Sage bug or a Maxima bug/feature. Depends on how you look at it.
- Option 1: We don't expect an = sign inside of expressions in our parser in sage/misc/parser.py. Once you leave Parser.p_eqn, there is a lot of jumping around that happens, but it never gets back there, and that is the only place that replaces = with ==. So we should fix that.
- Option 2: Maxima erroneously doesn't change
e^(y=x)
toe^y=e^x
. With log, it does:sage: var('y'); a = (y==x).log() sage: a._maxima_() log(y)=log(x)
But with exp, it doesn't:sage: var('y'); a = (y==x).exp() y sage: a._maxima_() %e^(y=x)
For now putting the upstream as 'none of the above' since it's not clear the bug is upstream.
Change History (5)
comment:1 Changed 10 years ago by
- Report Upstream changed from None of the above - read trac for reasoning. to Reported upstream. Developers deny it's a bug.
comment:2 Changed 8 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:3 Changed 7 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:4 Changed 7 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:5 Changed 7 years ago by
- Milestone changed from sage-6.3 to sage-6.4
Note: See
TracTickets for help on using
tickets.
See this Maxima list message, and the ensuing comments, for more information.
For now I'm putting this as "upstream denies bug" because the sense on the list was not unanimous that it should always happen; certainly one doesn't always want to expand the
==
, though forexp
one might want to.Robert Dodier had a partial fix:
However, this would not work with
%e^(y=x)
, onlyexp(y=x)
, apparently.