Fixed a formula to calculate the relative error