an implementation of the L^2 algorithm using GMP's mpf