Some code I used to investigate the numerical stability of a sum given in O. Korotkova: "Random sources for rectangular far fields" Opt. Let. 2014