A program generator for efficient evaluation of fourier series
Bruce R. Miller · 1989
Many fields require the evaluation of large multi-variate Fourier series, but the naive method of calling sine and cosine for each term can be prohibitive where computing resources are constrained or the series are extremely large (30,000 terms). Although the number of such calls can be reduced by using trigonometric identities, such a reduction is usually not possible by hand. Indeed, even when it is carried out by computer, care must be taken to generate compact programs and avoid generating large numbers of intermediate terms. We describe here an algorithm for automatically generating very efficient Fortran programs directly from the mathematical description of the series to be evaluated. The resulting Fortran programs are 5-7 times faster than the naive version and sometimes significantly more compact.