Fourier versus difference methods in computing three-dimensional MHD equilibria