In this paper, we present a numerical algorithm for the accurate and efficient computation of the convolution of the frequency domain layered media Green's function with a given density function. Instead of compressing the convolution matrix directly as in the classical fast multipole method, fast direct solvers, and fast H-matrix algorithms, the new algorithm considers a translated form of the original matrix so that many existing building blocks from the highly optimized free-space fast multipole method can be easily adapted to the Sommerfeld integral representations of the layered media Green's function. An asymptotic analysis is performed on the Sommerfeld integrals for large orders to provide an estimate of the decay rate in the new "multipole" and "local" expansions. In order to avoid the highly oscillatory integrand in the original Sommerfeld integral representations when the source and target are close to each other, or when they are both close to the interface in the scattered field, mathematically equivalent alternative direction integral representations are introduced. The convergence of the multipole and local expansions and formulas and quadrature rules for the original and alternative direction integral representations are numerically validated.