  Gravitational-wave observations of double compact object (DCO) mergers are
providing new insights into the physics of massive stars and the evolution of
binary systems. Making the most of expected near-future observations for
understanding stellar physics will rely on comparisons with binary population
synthesis models. However, the vast majority of simulated binaries never
produce DCOs, which makes calculating such populations computationally
inefficient. We present an importance sampling algorithm, STROOPWAFEL, that
improves the computational efficiency of population studies of rare events, by
focusing the simulation around regions of the initial parameter space found to
produce outputs of interest. We implement the algorithm in the binary
population synthesis code COMPAS, and compare the efficiency of our
implementation to the standard method of Monte Carlo sampling from the birth
probability distributions. STROOPWAFEL finds $\sim$25-200 times more DCO
mergers than the standard sampling method with the same simulation size, and so
speeds up simulations by up to two orders of magnitude. Finding more DCO
mergers automatically maps the parameter space with far higher resolution than
when using the traditional sampling. This increase in efficiency also leads to
a decrease of a factor $\sim$3-10 in statistical sampling uncertainty for the
predictions from the simulations. This is particularly notable for the
distribution functions of observable quantities such as the black hole and
neutron star chirp mass distribution, including in the tails of the
distribution functions where predictions using standard sampling can be
dominated by sampling noise.
