Follows somewhat the advice of Knuth on checking for floating-point
equality. The closeness relationship is:
$$
\mathrm{close}(x,y,n) \equiv |x-y| \leq \varepsilon |x|
\wedge |x-y| \leq \varepsilon |y|
$$
where $ \varepsilon $ is $ n $ times the machine accuracy;
$ n $ equals 42 if not given.
Follows somewhat the advice of Knuth on checking for floating-point
equality. The closeness relationship is:
$$
\mathrm{close}(x,y,n) \equiv |x-y| \leq \varepsilon |x|
\vee |x-y| \leq \varepsilon |y|
$$
where $ \varepsilon $ is $ n $ times the machine accuracy;
$ n $ equals 42 if not given.
Follows somewhat the advice of Knuth on checking for floating-point equality. The closeness relationship is: $$ \mathrm{close}(x,y,n) \equiv |x-y| \leq \varepsilon |x| \wedge |x-y| \leq \varepsilon |y| $$ where $ \varepsilon $ is $ n $ times the machine accuracy; $ n $ equals 42 if not given.