This took way longer than expected. First, I noticed that mixed up
sparse and dense terms so I fixed that. Then I extended the rational
package to use generic operations. However, I did not work and it took
me two hours to find the root cause. The problem was that appply-generic
tried to raise raise and drop the rationals with polynomials. The
rational to scheme and rational to real procedures do not support
polynomials which caused the error. I changed these procedures so that
they only attempt coercion of the arguments are numbers. This is not
fully correct as it destroys our ability to have rationals of rationals,
for example, but good enough for our purposes.