> In http://trac.sagemath.org/ticket/14630, I have a patch that adds a > simplify_real() method to symbolic expressions. Pretty much the only > thing it does is simplify, > > sqrt(x^2) -> abs(x) > > In the past, you could obtain this with simplify_radical(), even though > the variable `x` involved was assumed to be complex. That was busted, so > it was removed. But some people need the simplification above (see e.g. >
Just to clarify, current behavior is sage: a = sqrt(x^2) sage: a.simplify_radical() x > #14305), so the patch at least provides a way to get it. > > Still well worth a read, though perhaps too many opinions to come to resolution. Anyway, as to your solution, I think that after this time rws is probably right that since no one actually implemented a context manager or domain parameter or whatever else then the option on the ticket (which needs to be a branch, sigh) is better than nothing. At least it finally allows sqrt(x^2) -> abs(x) again. Though it should be tried with lots of irrelevant and perhaps strange assumptions like integer around to make sure it really re-assumes all assumptions when needed. > So you're kind of on your own regarding how many simplifications to try and in what order. Yes, that is currently the case anyway. -- 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/d/optout.