\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\begin{array}{l}
\mathbf{if}\;\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right| \leq 1.4271271070981694 \cdot 10^{-113}:\\
\;\;\;\;\left|\frac{x + 4}{y} - x \cdot \frac{z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(\frac{x}{y} + 4 \cdot \frac{1}{y}\right) - \frac{x}{y} \cdot z\right|\\
\end{array}(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
(FPCore (x y z) :precision binary64 (if (<= (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))) 1.4271271070981694e-113) (fabs (- (/ (+ x 4.0) y) (* x (/ z y)))) (fabs (- (+ (/ x y) (* 4.0 (/ 1.0 y))) (* (/ x y) z)))))
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 tmp;
if (fabs(((x + 4.0) / y) - ((x / y) * z)) <= 1.4271271070981694e-113) {
tmp = fabs(((x + 4.0) / y) - (x * (z / y)));
} else {
tmp = fabs(((x / y) + (4.0 * (1.0 / y))) - ((x / y) * z));
}
return tmp;
}



Bits error versus x



Bits error versus y



Bits error versus z
Results
if (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))) < 1.4271271070981694e-113Initial program 7.0
rmApplied div-inv_binary647.0
Applied associate-*l*_binary640.1
Simplified0.1
if 1.4271271070981694e-113 < (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))) Initial program 0.2
Taylor expanded around 0 0.2
Final simplification0.2
herbie shell --seed 2021166
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))