optimized ms roundoff