On Aug 5, 9:40 am, kcrisman <kcris...@gmail.com> wrote: > On Aug 5, 8:58 am, kcrisman <kcris...@gmail.com> wrote: > > > > > > > Thanks, Maik, for this report. Yes, our Maxima conversion seems to be > > at fault. > > > 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 > > <boom> > > > I'll take a look at this, I doubt it will be very hard to fix, as it > > just isn't replacing the "=" from Maxima with "==" again - > > It seems to be a bit deeper than this, unfortunately. Something about > the parser - perhaps it's not recognizing something about the y=x in > the expression tree for exponentiation, but is for log. >
I'll try to open a ticket for this when Trac is back up. Basically, one can consider the problem in two ways - a Sage bug or a Maxima bug/ feature. 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 ==. 2) Maxima erroneously doesn't change e^(y=x) to e^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) Anyway, I agree this should be fixed, but not sure what the "right" fix is. Robert Bradshaw, who wrote the parser, might have a comment on whether it would be easy/advisable to change it. I'm going to ask the Maxima list about the other thing - usually Maxima is pretty careful about simplifying things with exponents (because such simplifications are not always true!) but in this case I'm not sure how they would even interpret this expression. - kcrisman -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org