Small optimization for computing error