Short answer, "No."

In full generality what you're describing is actually a challenging search
problem.  We've thought about attacking this problem more rigorously in
SymPy but haven't gotten around to it except in a few small cases like trig
simplification (see fu function).


On Mon, May 19, 2014 at 2:54 PM, Mike Witt <[email protected]> wrote:

> Is it typical to have to "fiddle around" with different
> forms of an expression to get it to simplify? For example:
>
> In [7]: from sympy import sqrt
>
> In [8]: foo=-sqrt(-2*sqrt(2)+3)+sqrt(2*sqrt(2)+3)
>
> In [9]: print foo
> -sqrt(-2*sqrt(2) + 3) + sqrt(2*sqrt(2) + 3)
>
> In [10]: print foo.simplify()
> -sqrt(-2*sqrt(2) + 3) + sqrt(2*sqrt(2) + 3)
>
> In [11]: print (foo**2).expand()
> -2*sqrt(-2*sqrt(2) + 3)*sqrt(2*sqrt(2) + 3) + 6
>
> In [12]: print (foo**2).expand().simplify()
> 4
>
> Or is there some kind of "general strategy" that will
> always work (assuming there is clearly a simplification
> possible, like an integer as above)?
>
> -Mike
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/1400536494.2532.18%40Vector.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAJ8oX-GcukOnuDvtFUJ2ukp_8v%2BtKYGogdSKRRxDZTbdkDnVtg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to