  By merging algorithmic Matsubara integration with discrete pole
representations we present a procedure to generate fully analytic closed form
results for impurity problems at fixed perturbation order. To demonstrate the
utility of this approach we study the Bethe lattice and evaluate the second
order self-energy for which reliable benchmarks exist. We show that, when
evaluating diagrams on the Matsubara axis, the analytic sums of pole
representations are extremely precise. We point out the absence of a numerical
sign problem in the evaluation, and explore the application of the same
procedure for real-frequency evaluation of diagrams. We find that
real-frequency results are subject to noise that is controlled at low
temperatures and can be mitigated at additional computational expense. We
further demonstrate the utility of this approach by evaluating dynamical
mean-field and bold diagrammatic self-consistency schemes at both second and
fourth order and compare to benchmarks where available.
