Thanks for your explanation. So it is clear that radcan ignore assumptions. As already mentioned by kcrisman, radcan does not take into account the option variable radexpand, which, if set to 'true' (and domain to 'real'), would do the job, as suggested in the documentation http://maxima.sourceforge.net/docs/manual/en/maxima_9.html
Prof. Richard Fateman, since it seems that you are the primary author of radcan (am I correct ?), would it require a lot of work to make a new version of radcan (with a new name, in order not to alter the current one), so that it takes radexpand into account ? Eric. Le mercredi 19 juin 2013 13:38:18 UTC+2, Michael Orlitzky a écrit : > > On 06/19/2013 03:03 AM, Eric Gourgoulhon wrote: > > > > Thanks for your explanation regarding how radcan works. > > > > If radcan ignores assumptions, how can one explain the following > behavior: > > > > sage: assume(x<0) > > sage: sqrt(x^2).simplify_radical() > > x > > sage: maxima_calculus.eval('domain:real') > > 'real' > > sage: sqrt(x^2).simplify_radical() > > -x > > > > It seems that assuming the domain is 'real' had an effect on radcan. > > > > The code for simplify() just sends an expression to Maxima and back: > > return self._parent(self._maxima_()) > > If you set the domain to real, and send that expression to Maxima and > back, you get abs(x): > > sage: _ = maxima_lib.eval('domain:real') > sage: sqrt(x^2).simplify() > abs(x) > > Now if you assume x<0, you get -x. > > In simplify_radical(), we necessarily have to send the expression > through Maxima in order to call radcan() on it. As soon as the > expression hits Maxima, the above simplification happens (before radcan > can do anything). > > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.