\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\begin{array}{l}
t_0 := \frac{x + 4}{y}\\
\mathbf{if}\;x \leq -5.0757937571568445 \cdot 10^{-110}:\\
\;\;\;\;\left|t_0 - \frac{x}{y} \cdot z\right|\\
\mathbf{elif}\;x \leq 5.121491754412143 \cdot 10^{-14}:\\
\;\;\;\;\left|\frac{x}{y} - \frac{\mathsf{fma}\left(x, z, -4\right)}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t_0 - \frac{z}{\frac{y}{x}}\right|\\
\end{array}
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y)))
(if (<= x -5.0757937571568445e-110)
(fabs (- t_0 (* (/ x y) z)))
(if (<= x 5.121491754412143e-14)
(fabs (- (/ x y) (/ (fma x z -4.0) y)))
(fabs (- t_0 (/ z (/ y x))))))))double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
double code(double x, double y, double z) {
double t_0 = (x + 4.0) / y;
double tmp;
if (x <= -5.0757937571568445e-110) {
tmp = fabs((t_0 - ((x / y) * z)));
} else if (x <= 5.121491754412143e-14) {
tmp = fabs(((x / y) - (fma(x, z, -4.0) / y)));
} else {
tmp = fabs((t_0 - (z / (y / x))));
}
return tmp;
}



Bits error versus x



Bits error versus y



Bits error versus z
if x < -5.0757937571568445e-110Initial program 0.6
if -5.0757937571568445e-110 < x < 5.12149175441214306e-14Initial program 2.9
Simplified0.1
Applied egg-rr0.1
if 5.12149175441214306e-14 < x Initial program 0.1
Applied egg-rr0.2
Final simplification0.2
herbie shell --seed 2022130
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))