Maxima's rat package and "quotient is not exact"



Hi,

it looks like rational package uses f<, f+, ... macros on coefficients
of polynomials in a lot of places. This causes problems when the
coefficients are bignums. I think this could be a cause of at least
some of the bugs. For example

(%i1) diff(integrate(1/(x^5+1), x), x)$
(%i2) :lisp (trace prem);
(PREM)
(%i2) ratsimp(%o1);

[ some output deleted ]

  <1 (PREM (#:X33660 2
               (#:|sqrt(5)33660| 1 -29362176000000000 0
                   -66852864000000000)
               1
               (#:|sqrt(5)33660| 1 -18745344000000000 0
                   -39979008000000000)
               0
               (#:|sqrt(5)33660| 1 -29362176000000000 0
                   -66852864000000000)))
  1> (PREM (#:X33660 3 (#:|sqrt(5)33660| 1 -288000) 2
               (#:|sqrt(5)33660| 1 672000 0 480000) 1
               (#:|sqrt(5)33660| 1 48000 0 720000) 0
               (#:|sqrt(5)33660| 1 528000 0 1200000))
           (#:X33660 2 (#:|sqrt(5)33660| 1 -48000000 0 -265600000) 1
               (#:|sqrt(5)33660| 1 -108800000 0 12800000) 0
               (#:|sqrt(5)33660| 1 -48000000 0 -265600000)))
  <1 (PREM 0)
  1> (PREM (#:|sqrt(5)33660| 1 17 0 -2) (#:|sqrt(5)33660| 1 15 0 83))
  <1 (PREM -1441)
(%o2) ((30*sqrt(5)+150)*x^3-60*sqrt(5)*x^2-60*sqrt(5)*x+30*sqrt(5)+350)/(800*x^5+800)

I'm not saying that there is a bug in prem but clearly some
coefficients are not fixnums and the output is wrong and maybe there
is a connection.

BTW:

(%i3) ratsimp(%o1), gcd=spmod;
(%o3) 1/(x^5+1)

so this this looks like a gcd bug.

Andrej