Improved algorithms for approximate quantum fourier transforms and sparse hamiltonian simulations