Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The obvious try works already:

sage: var( 'x,y,z' );
sage: E = (-524288*x^2 - 1048576*x*y - 524288*y^2 + 524288*x*z + 524288*y*z)/(-1048576*z^2)
sage: E
1/2*(x^2 + 2*x*y + y^2 - x*z - y*z)/z^2
sage: E.factor()
1/2*(x + y - z)*(x + y)/z^2
sage: E.simplify_full()
1/2*(x^2 + 2*x*y + y^2 - (x + y)*z)/z^2
sage: version()
'SageMath version 8.0, Release Date: 2017-07-21'

Notes:

  • Why RR.zero()...?
  • Please define also x,y,z when these variables are used.
  • u was not defined.
  • Please give code pointed for the question. The question was

    Is there any way to make sage automatically simplify the coefficients?

    and in the list of answers there is also:

    (1/2x^2 + xy + 1/2y^2 - 1/2xz - 1/2y*z)/z^2

    This is simplified enough for my taste.

  • And the mix of xy with y*z is really not welcome. My first thought was, that xy was the error.