[Maxima] Comments about FFT PATCH ready
raymond.toy at stericsson.com
Wed Sep 2 12:40:26 CDT 2009
Žiga Lenarčič wrote:
> On Sep 2, 2009, at 7:12 PM, Raymond Toy wrote:
>> Žiga Lenarčič wrote:
>>> It works nicely with 'flonum', yes. I changed it to use add and mul,
>>> added your changes from CVS, used flonum instead of double-float...
>>> See the attached file.
>> I didn't mean to imply that you should make the changes, but thanks!
>> There is one other issue. The FFT routine uses pi, which is a
>> long-float. We need to fix that. However, with cmucl's
>> double-double-float type, pi is not a double-double-float, so we'd have
>> to adjust for that.
>> As a quick check, I tried the original fft on a 8K input. It takes 1.6
>> sec, of which 1.09 is spent just in $fft. fft-dif-internal takes just
>> 0.15 sec.
>> With your latest code, that same test takes 0.11 sec, of which 0.06 is
>> spent in fft+ifft-common, and fft-dif-internal takes just 0.01.
>> (Yes, this is near the limit of granularity, but it does give a rough
> (declare (type flonum +flonum-pi+))
> (defconstant +pi-flonum+ ...)
> in clmacs.lisp for each flonum case (double, doubledouble, clisp's
> long ?) would fix this. I know there is already a numerical Pi defined
> somewhere - but it's better to define it specially for 'flonum'
> numerical cases (perhaps same for %e).
Perhaps defining maxima::pi and shadowing cl:pi would be better. Then
all uses of pi will get the correct value. This also "fixes" the issue
that pi is defined to be a long-float. For most lisps, long-float =
double-float, but that's not true on clisp, so computations with pi
could take much longer, especially if you've inadvertently told clisp to
use zillion-digit long-floats.
I'm not planning on doing this though.
Does anyone actually compile maxima with flonum other than the default
double-float? I don't.
More information about the Maxima