Two minor revisions:
## inhibit rearrangement
Context() -> reduction -> set( '(-x)+y' => 0, '(-x)-y' => 0 ) ;
## repeat reduction of $poly to remove parentheses
## around constant if it is the last term
$poly = Compute( "$poly" ) -> reduce ;
I suspect the first use of reduce would replace "+ (-5 x^0)" with "+ (-5)" and the second reduce yields "- 5". It is unclear why the second step is not needed if the constant is not the last term.
WeBWorK Problems
Q: random polynomial
This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at 10 posting(s) in 1 day