Numerical evaluation of plane-wave diffraction by a doubly periodic grating