Refs #8622 new function to calculate errors without changing UB