An improved FFT-based version of Ramaswami's formula