Using GMP functions instead of regular solve statement