> -----Original Message-----
> From: Barton Willis [mailto:willisb at unk.edu]
> Sent: Wednesday, March 26, 2008 10:28 AM
> To: fateman at EECS.Berkeley.EDU
> Cc: 'Maxima List'; maxima-bounces at math.utexas.edu; 'Raymond
> Toy (RT/EUS)'
> Subject: Re: [Maxima] Ordering of vector variables?
>
> To simplify a1 + a2 + ... + an, Maxima calls great O(n^2)
> times.
Right
> That's too many. I think simplus could make better use of
> sorting to reduce the number of calls to great---you don't have to
> change 'great' to do that.
Right. I think that if you strip it all down, you have an insertion sort.
However there are subtleties, like (+ 3 4 2) doesn't get sorted, it gets
added to make 9.
> I suppose the speedup isn't comparable to
> speed-up described in ``Experiments in Hash-coded Algebraic
> Simplification.''
I haven't tried just this.
Another simple idea..
"great" uses "great" recursively, too, and that can be fixed by memoization.
this may be the simplest fix, and someone might explore just this. To read
about memoization, see Norvig's code, or the various attempts to generalize
it, which you can find via google.
>
> Barton
>
>