Am Dienstag, den 08.12.2009, 06:57 -0600 schrieb Barton Willis:
> I committed some (obvious) changes to altsimp. With these changes,
> altsimp runs the testsuite with fewer errors (and maybe no
> mathematical errors), and it fixes two (minor) known bugs:
>
> taylor(exp(x), x, 0, 2) - taylor(exp(x), x, 0, 0) --> 0 + ... (not 0)
> is(compare(inf, 7 + inf) = "=") --> true (not false).
>
> Using altsimp, rtest_expintegral test #148 reports
> -1.387778780781446b-17, instead of the expected 0.0b0. The number
> -1.387778780781446b-17 looks suspect--is it due to a bogus double to
> big float conversion?
>
> It's a bit surprising that sum(sqrt(3), i, - 1, 1) --> 3 * sqrt(3) with
> altsimp and
> 3^(3/2) with the standard.
>
> Finally, timings for the testsuite: with altsimp: (Clozure CL 1.4 + XP)
>
> 874,563 milliseconds (874.563 seconds) to run with 1 available CPU core.
> During that period, 735,719 milliseconds (735.719 seconds) were spent in
> user mode
> 31,594 milliseconds (31.594 seconds) were spent in
> system mode
> 182,703 milliseconds (182.703 seconds) was spent in GC.
> 3,247,185,512 bytes of memory allocated.
>
> Without simplus:
>
> 538,547 milliseconds (538.547 seconds) to run with 1 available CPU core.
> During that period, 497,031 milliseconds (497.031 seconds) were spent in
> user mode
> 7,484 milliseconds (7.484 seconds) were spent in system
> mode
> 24,359 milliseconds (24.359 seconds) was spent in GC.
> 3,982,627,096 bytes of memory allocated.
>
> One big timing difference is that altsimp spends 159 more seconds in GC.
> This might be due
> to creating a new hash table each time through simplus?
>
> Again, altsimp is educational (for me), but it might be more of a
> distraction than useful. A good
> algorithm shouldn't depend on the details of simplification, so there might
> be some use
> in having an alternative simplifier for testing some algorithms.
I would like to add one observation.
I have added some code to simplus to collect a statistic. I have counted
how often the routine is called and I had a look at the number of
arguments for every call.
For the testsuite I get the following results:
simplus is called 4,050,312 times
args calls
1 526,448 13,00%
2 3,435,293 84,82%
3 56,351 1,39%
For 99,2% cases the function simplus is called with 1, 2, or 3
arguments. The maximum number of args is 55.
I think this is the reason why more sophisticated code is much slower
than the actual implementation.
The testsuite might be not typical for special calculations. On the
other side Maxima has to be useful for a lot of different applications.
Perhaps the testsuite with its thousands of calculations is a good test
for a lot of typical applications.
Dieter Kaiser