Java implementation of the Gauss–Legendre algorithm