Accurate calculation of Green functions on the d-dimensional hypercubic lattice
We write the Green function of the $d$-dimensional hypercubic lattice in a piecewise form covering the entire real frequency axis. Each piece is a single integral involving modified Bessel functions of the first and second kinds. The smoothness of the integrand allows both real and imaginary parts of the Green function to be computed quickly and accurately for any dimension $d$ and any real frequency, and the computational time scales only linearly with $d$.