\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\begin{array}{l}
\mathbf{if}\;x \le -71921344804687528:\\
\;\;\;\;\left|\frac{x + 4}{y} - x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \le 2.64879301323564412 \cdot 10^{-10}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y} \cdot \left(1 - z\right) + 4 \cdot \frac{1}{y}\right|\\
\end{array}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 temp;
if ((x <= -7.192134480468753e+16)) {
temp = fabs((((x + 4.0) / y) - (x * (z / y))));
} else {
double temp_1;
if ((x <= 2.648793013235644e-10)) {
temp_1 = fabs((((x + 4.0) - (x * z)) / y));
} else {
temp_1 = fabs((((x / y) * (1.0 - z)) + (4.0 * (1.0 / y))));
}
temp = temp_1;
}
return temp;
}



Bits error versus x



Bits error versus y



Bits error versus z
Results
if x < -7.192134480468753e+16Initial program 0.1
rmApplied div-inv0.2
Applied associate-*l*0.2
Simplified0.1
if -7.192134480468753e+16 < x < 2.648793013235644e-10Initial program 2.6
rmApplied associate-*l/0.1
Applied sub-div0.1
if 2.648793013235644e-10 < x Initial program 0.1
Taylor expanded around 0 8.9
Simplified0.1
Final simplification0.1
herbie shell --seed 2020049
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4) y) (* (/ x y) z))))