renamed residual_norm to relative_error