Richard,
> subres is no longer new. It is about 40 years old.
> the choice of which gcd algorithm to use for polynomials
> depends on the kinds of inputs and the expected output.
> For example, if you expect the gcd to be large,
> subres is good.
Thanks for the info -- I will try to update the text for gcd.
It appears that gcd wants to treat its arguments as polynomials
unless they are both integers or rationals.
(Although I don't know if that explains gcd (%e, sqrt(2)/2); => 1/2.)
Two ideas here --
(1) we can rename gcd to polygcd and create a new gcd function.
The new gcd would treat its arguments as numbers
(or expressions which eventually evaluate to numbers).
(2) patch up existing gcd so that the value returned is
indeed a divisor of both arguments. (Maybe there is nothing
to fix here -- maybe 1/2 is a divisor of irrational numbers
under a general-enough definition of divisor.)
About (1), we recently went through a similar discussion
about mod and nummod. The outcome was that mod was
renamed to polymod and nummod to mod.
For what it's worth,
Robert Dodier