> I'm still unclear about the arguments
> over asymmetric vs symmetric (I suspect, as you alluded to earlier,
> that they reflect a more fundamental problem, which is that there are
> 2 different types of use case with different constraints) so I'd like
> to at least be aware of the content of any discussion...
Asymmetry is bad, because it is rather surprising and counter-intuitive
that "x is close to y", but "y is not close to x". It may also be bad in
a practical sense, because people will forget which order they need to
give x and y and will give them in the wrong order. I started off with
an approx_equal function in test_statistics that was symmetric, and I
could never remember which way the arguments went.
Instead, Bruce Dawson recommends using the larger of x and y:
https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
Quote:
To compare f1 and f2 calculate diff = fabs(f1-f2). If diff is
smaller than n% of max(abs(f1),abs(f2)) then f1 and f2 can be
considered equal.
Time permitting, over the next day or so I'll draw up some diagrams to
show how each of these tactics change what counts as close or not close.