  Several problems in computer algebra can be efficiently solved by reducing
them to calculations over finite fields. In this paper, we describe an
algorithm for the reconstruction of multivariate polynomials and rational
functions from their evaluation over finite fields. Calculations over finite
fields can in turn be efficiently performed using machine-size integers in
statically-typed languages. We then discuss the application of the algorithm to
several techniques related to the computation of scattering amplitudes, such as
the four- and six-dimensional spinor-helicity formalism, tree-level recursion
relations, and multi-loop integrand reduction via generalized unitarity. The
method has good efficiency and scales well with the number of variables and the
complexity of the problem. As an example combining these techniques, we present
the calculation of full analytic expressions for the two-loop five-point
on-shell integrands of the maximal cuts of the planar penta-box and the
non-planar double-pentagon topologies in Yang-Mills theory, for a complete set
of independent helicity configurations.
