You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that this approve results in very large relative error even if the absolute error is small. For example, (v = 1e-8, v_ref = 0, eps = 1e-10), then ref_diff = 100. We can use more reasonable definition, for example: rel_diff = (v - v_ref) / max(|v|, |v_ref|). See https://en.wikipedia.org/wiki/Relative_change_and_difference for other alternatives.
In the mentioned wiki article all relative difference definitions are not defined when the f(x,y) is equal to zero. IMHO this is the special case which should be treated separately.
Activity
j4yan commentedon Mar 25, 2022
The suggested definition doesn't work when
v = v_ref = 0(most likely happens for integers), so we should check it first.asroy commentedon Mar 30, 2022
what about:
rel_diff = (v - v_ref) / max(|v|, |v_ref|, |eps|)?
j4yan commentedon Mar 31, 2022
It covers the corner case I mentioned above, but why do we introduce a user-defined and hard-coded variable?
aosewski commentedon Mar 31, 2022
In the mentioned wiki article all relative difference definitions are not defined when the
f(x,y)is equal to zero. IMHO this is the special case which should be treated separately.j4yan commentedon Mar 31, 2022
@asroy Agree with @aosewski.