[sage-devel] GiNaC as the symbolic manipulation engine in Sage



William Stein wrote:

> I have seen a lot of *real* benchmarks involving symbolic calculus
> when sad users and students come to me and ask why their code
> is 1000 times slower than Mathematica.  This happened a *few* times
> today at Sage Days 9 today.  It also comes up in sage-support all
> the time.  I really need to come up with a large list of specific examples
> like this, since I'm getting way too confused by benchmarks.

Yeah. I 'd like to see that list, when you have it.

In the case of the summation problem mentioned in this thread,
the central problem is that Maxima's simplification algorithm
for the result (something of the form (x + y)^2 + (x + y)^4 + ...)
seems to run in n^2 time where n is the number of terms.

There is also a trade-off in the summation algorithm:
in this case it would be faster to generate a list of all the
terms and then apply "+" to them, but if all the terms are
numbers, the calculation could be done in constant space
by adding each term to a running total; the latter is the
current implementation. Probably the trade-off should go
the other way; I 'll look at that.

I'll look at the "+" simplification algorithm to see if I can see
a way to speed it up. Interested parties may direct
followups to the Maxima mailing list.

best

Robert Dodier