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



Bits error versus x



Bits error versus y



Bits error versus z
Results
if x < -2.8755087116004516e-15Initial program 0.1
rmApplied div-inv_binary64_750.2
Applied associate-*l*_binary64_190.1
Simplified0.1
if -2.8755087116004516e-15 < x < 4.75799173626720961e24Initial program 2.4
Taylor expanded around 0 2.4
Simplified2.4
rmApplied associate-*l/_binary64_210.2
Applied flip-+_binary64_5225.7
Applied frac-sub_binary64_8725.8
Simplified0.3
Simplified0.3
if 4.75799173626720961e24 < x Initial program 0.1
Taylor expanded around 0 0.1
Final simplification0.2
herbie shell --seed 2021022
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))