  For problems of time-harmonic scattering by rational polygonal obstacles,
embedding formulae express the far-field pattern induced by any incident plane
wave in terms of the far-field patterns for a relatively small
(frequency-independent) set of canonical incident angles. Although these
remarkable formulae are exact in theory, here we demonstrate that: (i) they are
highly sensitive to numerical errors in practice, and (ii) direct calculation
of the coefficients in these formulae may be impossible for particular sets of
canonical incident angles, even in exact arithmetic. Only by overcoming these
practical issues can embedding formulae provide a highly efficient approach to
computing the far-field pattern induced by a large number of incident angles.
Here we address challenges (i) and (ii), supporting our theory with numerical
experiments. Challenge (i) is solved using techniques from computational
complex analysis: we reformulate the embedding formula as a complex contour
integral and prove that this is much less sensitive to numerical errors. In
practice, this contour integral can be efficiently evaluated by residue
calculus. Challenge (ii) is addressed using techniques from numerical linear
algebra: we oversample, considering more canonical incident angles than are
necessary, thus expanding the set of valid coefficient vectors. The coefficient
vector can then be selected using either a least squares approach or column
subset selection.
