Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In order to establish if two expressions are equal, sage performs a "default wash machine program" and in case there is a proof for the True value, it returns this True. Else it returns False.

In such cases, one should help sage to find the truth.

In our case:

sage: expression = abs(-1+sqrt(2)) != abs(1-sqrt(2))
sage: bool(expression)
sage: bool(expression.simplify_full())

Just tell sage to perfom a simplification of the expression!

Note: One can find many "bugs" like the posted one, just try for instance:

sage: bool( abs(-1+sqrt(2)) != abs(1-sqrt(2)) )
sage: bool( abs(-1+sqrt(2)) == abs(1-sqrt(2)) )