# How to do Fast Fourier transform (FFT) for singular functions?

I want to do a 3-dimensional FFT on this function $\frac{\cos (x) \cos (y) \cos (z)-\sin (x) \sin (y) \sin (z)}{\left((1.0001+\sin (y)+\cos (z))^2+(0.0001+\cos (x)+\sin (z))^2+(0.0001+\sin (x)+\cos (y))^2\right)^{3/2}}$ for it looks intractable via analytical Fourier expansion. Let's denote the number of numerical sampling points in each dimension as $N$. Here's the Mathematica code.

nn = 10; step = (2 \[Pi])/nn; mx0 = 1.0001; my0 = 0.0001; mz0 = 0.0001;
data = Table[ ( Cos[x] Cos[y] Cos[z] - Sin[x] Sin[y] Sin[z])/((mz0 + Cos[y] + Sin[x])^2 + (mx0 + Cos[z] + Sin[y])^2 + (my0 + Cos[x] + Sin[z])^2)^(3/2), {x, 0, 2 \[Pi] - step, step}, {y, 0, 2 \[Pi] - step, step}, {z, 0, 2 \[Pi] - step, step}];
s = Fourier[data, FourierParameters -> {-1, -1}]; s[[1, 1, 1]]


As far as I've tried, using Fast Fourier Transform routine from either C++ MKL library or Mathematica, the transformation result doesn't converge even when $N=500$, oscillating extravagantly with respect to $N$ in fact. I checked the programs with many other non-singular functions, they turned out to be good. So I guess the problem may be caused by the special form of the singular function (denominator can be zero at some points). I tried $\frac{1}{0.9-\sin{(x+y+z)}}$. It doesn't oscillate so much, but still considerably.

Can anyone shed some light on this problem? Thanks in advance!

It's a question of function spaces. If your function is in $L^2$, then you know that you can approximate the function using a Fourier series because the Fourier basis (i.e., the sines and cosines) are dense in $L^2$. In other words, you know that if you take more and more terms of the series, then you will approximate the function better and better.
On the other hand, if your function is so singular that it doesn't belong to $L^2$, then all hope is lost: you cannot expect the Fourier series to converge.