added roundoff fix to cpu code