infinity correct maxima



There are a couple of ways of looking at this phenomena (of simplify being
called
on apparently identical things, and alike being called repeated on
irrelevant things.)

One is to fix the originating code.  I "fixed" simplify at one point because
it was,
in the main loop, checking to see if it was simplifying $%PI and if  $NUMER
was true.
Something dumb, left over.
my fix didn't get in, as I recall, because I didn't go in to CVS and do it.
I think
Barton's code fixes it.  But this turns out not to be a big time sink.
Sorting long
lists of summands is a time sink, since sorting is done badly and comparing
of terms
via  "GREAT" is slow.


Note that if simplify is called on  ((.... SIMP) ......)   then it just
returns almost
immediately, so it is probably not an issue in terms of time. 

If it is called repeatedly on the same unsimplified data and resimplifies
it, then there is
a different solution.  One can put the unsimplified data in a hash table as
well as its
simplified version, and look it up.  

This is what Maple sort of does.

This is also hazardous because changing flags can change the simplified
version.
This is potentially a problem in looking at an expression with a SIMP flag
-- and maybe
why it must sometimes be ignored.

Also hashing unsimplified expressions should be done in a clever way so
that, for example,

((mplus) x y z)   hashes to the same place as ((mplus) y x z)  or .... or
(mplus) ((mtimes) 1 x) y z 0)..

RJF




> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Robert Dodier
> Sent: Thursday, August 28, 2008 7:24 AM
> To: Barton Willis
> Cc: maxima at math.utexas.edu
> Subject: Re: [Maxima] infinity correct maxima
> 
> On 8/28/08, Barton Willis <willisb at unk.edu> wrote:
> 
> >  Maxima calls simplus 634 times;
> 
> >  Yikes! You'll also see the same sums done a dozen or more times
> >  in a row.
> 
> Hmm. I've also noticed that in some circumstances ALIKE1 is called
> over and over with apparently irrelevant arguments (stuff like
> (ALIKE1 0 '$%PI) iirc). Maybe we could get a constant-factor
> speed-up by revising some basic functions.
> 
> >  If it's OK with everybody, I'll place this code in a new 
> folder, say
> >  /share/contrib/altsimp.
> 
> OK by me.
> 
> By the way, what are the simplifications that this code does?
> 
> best
> 
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>