infinite loop on gcd()



I don't suppose some command could be written which :

a) tries subres for (say) 5 sec and if no answer has been returned
b) aborts subres and tries spmod for (say) 5 sec.
c) if neither solves it quickly, print a warning and then start one of
them (subres?) cranking with no time limit.

Would that be useful (or possible, for that matter?)  This way, if
there is a method which provides a quick answer (for some definition of
quick) the user always gets it immediately.

CY

--- "Viktor T. Toth"  wrote:
> Well, the algorithm may be mathematically correct but the fact is,
> subres
> often fails to produce a result even when you wait for hours, whereas
> spmod
> pops up the result in seconds or, perhaps, fails with a memory error
> within
> some reasonable amount of time.
> 
> Having said that, I'm happy to accept the consensus, if there's one,
> that
> subres represents the "lesser of two evils", so long as spmod remains
> there
> for cases that subres cannot deal with!
> 
> 
> Viktor
> 
> 
> 
>  
> 
> -----Original Message-----
> From: Richard Fateman [mailto:fateman at cs] 
> Sent: Tuesday, May 10, 2005 5:57 PM
> To: Viktor T. Toth; maxima
> Subject: Re: [Maxima] infinite loop on gcd()
> 
> 1. I don't believe there is a software algorithm bug.
> 2. Commercial macsyma gave up (illegal mem ref.) probably because
> it ran out of stack or memory. (A "system" bug?)
> 3. Subres works better  / faster much of the time.
> 4. spmod has its own regimes of bad performance, and I think
> that there are a number of reports of bugs in it, typically
> manifested by "polynomial quotient not exact" messages.
> 
> (What this means is someone computed p=gcd(r,s)  and then
> expected to produce a polynomial by exactly dividing r by p.
> But it didn't divide.)
> 
> 
> RJF
> 
> 
> Viktor T. Toth wrote:
> 
> >I pretty much got used to switching gcd to spmod for large
> calculations.
> >I've been meaning to ask, why does gcd default to subres (with all
> the
> bugs)
> >instead of the apparently far more reliable spmod algorithm?
> >
> >
> >Viktor
> >
> >  
> >
> 
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com