property list hack, profiling, compiler optimization, looking at code



That is, replace

   (let ((x ($realpart z)) (y ($imagpart z)))

with

    (let* ((ri (trisplit z)) (x (car ri)) (y (cdr ri)))...

in both functions.

             -s



On Sun, Aug 12, 2012 at 1:25 PM, Stavros Macrakis <macrakis at alum.mit.edu>wrote:

> Well, one easy improvement to (big-)flonum-eval is to call trisplit
> directly instead of calling it twice via realpart/imagpart.
>
> trisplit returns the cons of the realpart and the imagpart in a single
> calculation.  trisplit = top-level real/imaginary split.
>
> I suppose trisplit should be rewritten to use multiple-value-return (which
> didn't exist when it was written) to avoid 1 cons.
>
>               -s
>
> On Sun, Aug 12, 2012 at 7:49 AM, Barton Willis <willisb at unk.edu> wrote:
>
>> ________________________________________
>>
>> >Looks like there are a bunch of places to make this program run faster.
>> >zerop1 is near the top.  risplit  (real-imaginary-split ???) is there
>> too.
>>
>> The trig simplification code calls both flonum-eval  and big-float-eval.
>> Both of these functions call
>> $imagpart and $realpart. And both $imagpart and $realpart call risplit :(
>>
>> Fortunately for pure symbolic cases, such as cos(x), flonum-eval and
>> big-float-eval bail out with out calling
>> risplit.
>>
>>
>> --bw
>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>
>
>