Improving "testeq"

Michael Monagan

Abstract: Maple's routine testeq (written by Gaston Gonnet)
is a probabilistic method for testing whether an expression
is zero or not.  It does this by putting in random numbers
for variables and computing modulo a prime.  E.g.

     > exp(2*x)*x*(x-1)-exp(x)^2*(x^2-x);
                                                2   2
                     exp(2 x) x (x - 1) - exp(x)  (x  - x)

     > testeq(%);

I'll explain how testeq works and its limitations.
Using some number theory I'll suggest some extensions
that would make it possible for testeq to handle square roots
and trigonometric functions properly.