approx icon indicating copy to clipboard operation
approx copied to clipboard

Require the epsilon value (tolerance) to be specified explicitly, and remove the default

Open brendanzab opened this issue 7 years ago • 4 comments

As @Andlon explains:

I'm not sure if it's actually wise to provide a default epsilon/tolerance - this is the very problem that Bruce Dawson discusses in the randomascii blog I know we've both spent some time reading. The problem with absolute differences is that there is really no sensible default - it depends entirely on the numbers you are comparing.

brendanzab avatar Apr 25 '17 13:04 brendanzab

Note that I was referring explicitly to the absolute difference test for equality in that code, by the way. A default tolerance makes more sense for relative/ulp-based comparison.

Andlon avatar Apr 29 '17 20:04 Andlon

Right! Thanks for the clarification.

brendanzab avatar Apr 29 '17 21:04 brendanzab

What do you think a good default epsilon would be for ulps and relative?

brendanzab avatar Apr 30 '17 01:04 brendanzab

Which epsilon do you mean, exactly? The absolute difference for comparing near-zero numbers that Bruce Dawson advocates in his blog, or the tolerance used for comparison with relative error or ULPs respectively?

IIRC, I think the defaults you've already been using in this crate have been fairly sane.

Andlon avatar Apr 30 '17 15:04 Andlon