gcd problem



I think it would be plausible to restrict numeric exponents in canonical
rational form to fixnums, if an appropriate error message is provided.

That is, rat(x^1232121321213132313312+x+1) could give a message about too
large an exponent, and suggest that x^1233221...2  could be replaced by
another variable, e.g. xx  or "x^b",   so  you get "x^b"+x+1 for an answer.

Why do I feel this way about limits?  Well, there are some other places
where it is not just a fixnum silently becoming a bignum. For example,
consider rat((x^n-1)/(x-1))  where n is a bignum.  You have an answer with n
terms.  What's wrong with this?  Um, how much memory do you have??

So you can concoct examples where you bump up against some limits somewhere.
It is much preferable to say something like "do you really want to do that?"
than to silently go off for an hour or a day or ... or run out of stack or
memory or electricity.  Removing limits is not always a good idea if the
next step leads to an intolerable situation.

RJF

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu [mailto:maxima-
> bounces at math.utexas.edu] On Behalf Of Daniel Lakeland
> Sent: Tuesday, February 13, 2007 11:12 AM
> To: maxima at math.utexas.edu
> Subject: Re: [Maxima] gcd problem
> 
> On Tue, Feb 13, 2007 at 02:00:48PM -0500, Raymond Toy wrote:
> > >>>>> "Fabrizio" == Fabrizio Caruso <caruso at dm.unipi.it> writes:
> 
> > Perhaps things will run a little slower, but machines are hundreds
> > (thousands?) of times faster now than when maxima was originally
> > written.
> 
> Assuming moore's law holds, and that doubling in speed occurred every
> 1.5 years.... and macsyma was written initially in 1968 according to
> wikipedia...
> 
> 2^((2007-1968)/1.5) ~ 67 x 10^6 :-)
> 
> There are probably many things that maxima could do now that would
> take inconcievably long when the code was written. Even if we use 1982
> as the base year (the year maxima forked from macsyma) and "only" get
> a factor of 104032
> 
> I think the GCL result is the worst of the problems. There's nothing
> like a computation silently producing a seriously wrong answer
> somewhere in the middle where you don't notice it.
> 
> 
> --
> Daniel Lakeland
> dlakelan at street-artists.org
> http://www.street-artists.org/~dlakelan
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima