Semi-analytic theory of high-efficiency multilayer dielectric gratings