\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\begin{array}{l}
t_0 := \frac{x}{y} \cdot z\\
t_1 := \frac{x + 4}{y} - t_0\\
\mathbf{if}\;t_1 \leq -1.3368572763257305 \cdot 10^{+41}:\\
\;\;\;\;\left|\left(\frac{x}{y} + \frac{4}{y}\right) - t_0\right|\\
\mathbf{elif}\;t_1 \leq 1.417342327058317 \cdot 10^{-88}:\\
\;\;\;\;\left|\frac{x - \mathsf{fma}\left(x, z, -4\right)}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{-y} - t_0\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 y) z)) (t_1 (- (/ (+ x 4.0) y) t_0)))
(if (<= t_1 -1.3368572763257305e+41)
(fabs (- (+ (/ x y) (/ 4.0 y)) t_0))
(if (<= t_1 1.417342327058317e-88)
(fabs (/ (- x (fma x z -4.0)) y))
(fabs (- (/ (- -4.0 x) (- y)) t_0))))))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 / y) * z;
double t_1 = ((x + 4.0) / y) - t_0;
double tmp;
if (t_1 <= -1.3368572763257305e+41) {
tmp = fabs(((x / y) + (4.0 / y)) - t_0);
} else if (t_1 <= 1.417342327058317e-88) {
tmp = fabs((x - fma(x, z, -4.0)) / y);
} else {
tmp = fabs(((-4.0 - x) / -y) - t_0);
}
return tmp;
}



Bits error versus x



Bits error versus y



Bits error versus z
if (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z)) < -1.3368572763257305e41Initial program 0.1
rmApplied flip3-+_binary6420.6
Applied associate-/l/_binary6420.6
Simplified20.6
Taylor expanded around 0 0.1
Simplified0.1
if -1.3368572763257305e41 < (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z)) < 1.41734232705831705e-88Initial program 3.9
Simplified0.2
if 1.41734232705831705e-88 < (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z)) Initial program 0.2
rmApplied frac-2neg_binary640.2
Applied distribute-frac-neg_binary640.2
Final simplification0.2
herbie shell --seed 2021211
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))