maxima-bounces at math.utexas.edu wrote on 03/06/2011 04:00:13 PM:
> > (2) The function addk calls timeslk, but timeslk sends its
> arguments through *red. That's a bit inefficient, I think.
Oh, I see...yes timeslk has two calls to *red, but timeslk assumes that
its arguments are simplified (so *red isn't called on the *arguments* to
timeslk.)
The code in addk
(setq g (timeskl (list '(rat) 1 g) (list '(rat) (+ (* (cadr x) b) (*
(cadr y) a)) (* a b))))
is fast because it makes use of the fact (+ (* (cadr x) b) (* (cadr y)
a)) and (* a b) are
relatively prime. Maybe gcl doesn't use the fact that these numbers are
relatively prime?
A check for the g = 1 case probably isn't worth it.
Switching Maxima to use CL rationals isn't something that I'm not going to
attempt. I'd
make a mess of things for years to come, I think.
--Barton