1. A method for registering a first image and a second image the method comprising: using a programmable computer system having a processor to perform operations comprising: (a) computing quantities from a combination of the first image and the second image at a base registration location of the first image relative to the second image, wherein computing the quantities includes determining parameters that define an objective function from the first image and from the second image, wherein an argument of the objective function depends on a registration location relative to the base registration location, the objective function is defined on at least some continuous domain of registration locations according to a spatial interpolation of the first image, the objective function is an analytic function of the registration location, and the objective function is differentiable over at least some domain; and (b) processing the computed quantities to determine a globally optimal registration location within a continuous domain of registration locations relative to the base registration location, wherein processing the computed quantities includes optimizing the objective function based on the determined parameters to determine a desired registration of the first image and the second image, wherein optimizing the objective function includes locating one or more critical points of the objective function, and wherein locating the critical points includes finding roots of a polynomial.