On 05/10/2016 04:56 PM, Vincent Delecroix wrote:
> still
> 
> sage: n = SR.var('n')
> sage: assume(n, 'real')
> sage: assume(n >= 0)
> sage: bool(sqrt(pi)*sqrt(n) == sqrt(pi*n))
> False
> 

What `bool(expr1 == expr2)` does is something like,

  bool((expr1 - expr2).simplify_full() == 0)

As long as you're sure that everything involved is real, adding
simplify_real() into the mix will perform two extra simplifications that
simplify_full() will not, so you get better results in that case.

To make it Do The Right Thing by default, you would have to modify
simplify_full() to loop through all of the terms in the expression and
check if they're real. If they are, you could call simplify_real() in
addition to the other simplifications that simplify_full() does.

(There may be problems with that approach, but that's the idea, anyway.)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to