The Inverse Fast Fourier Transform is an algorithm that finds a polynomial such that , if , in time and space.

Algorithm

Lemma

Let

then

is a polynomial such that .

  1. Apply the Fast Fourier Transform to find .
  2. Apply the lemma to find .

This algorithm solves the problem in time and space.

void ifft(int n, std::vector<std::complex<double>> &a) {
	fft(n, a);
	std::ranges::reverse(a | std::views::drop(1));
	for (int i = 0; i < n; i++) {
		a[i] /= n;
	}
}