Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

iirc in fourier transforms, covolution of signals in time-domain is equivalent of signals in frequency-domain. thus 12 * 23 can be thought of as convolution of two signals (1,2) and (2,3) which gives (6,7,2)...


Yup. And you can then use the FFT to do super-fast multiplication. (I think you omitted something like "pointwise multiplication" after "equivalent of".) This is called "Strassen multiplication"; you can actually do better by doing your Fourier transforms not with complex numbers but with a different algebraic structure; that's called Schönhage-Strassen multiplication. I've seen it claimed that Strassen is actually faster in practice than Schönhage-Strassen.

Your numbers need to be pretty big before the benefits of this sort of algorithm outweigh the overheads, though. For instance, GMP uses naive multiplication up to about 600 bits, various Karatsuba/Toom-Cook schemes (divide-and-conquer) up to about 120,000 bits, and FFT after that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: