Probably the compiler optimizes this away anyway, but if you precompute `1/ w**2` and use multiplication inside the loop it should be faster.