Comments about FFT PATCH ready



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
> indication.)
>
> Ray
>

A
(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).

Ofcourse this 'flonum pi' should be used consistenly in all numerical  
Maxima code... Lack of documentation is a problem though - if anyone  
tries to extend maxima, he's supposed to know all these things that  
are different than when coding ordinary double-float lisp code..

Regards,
Ziga