Improved loop arithmetic in divrem_classical.