Correct tolerance value for sanity checks with ERROR_RELATIVE

Use min/max bounds instead of local value to calculate acceptance threshold.
Threshold based on local values somethimes does not work because cancellation
of big values may produce error bigger than local value.