\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\begin{array}{l}
\mathbf{if}\;x \leq -1.999698535205023 \cdot 10^{+108} \lor \neg \left(x \leq 4.179457532768889 \cdot 10^{-37}\right):\\
\;\;\;\;\left|\frac{4}{y} + \frac{x}{y} \cdot \left(1 - z\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{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 (or (<= x -1.999698535205023e+108) (not (<= x 4.179457532768889e-37))) (fabs (+ (/ 4.0 y) (* (/ x y) (- 1.0 z)))) (fabs (/ (- (+ x 4.0) (* x z)) y))))
double code(double x, double y, double z) {
return ((double) fabs(((double) ((((double) (x + 4.0)) / y) - ((double) ((x / y) * z))))));
}
double code(double x, double y, double z) {
double tmp;
if (((x <= -1.999698535205023e+108) || !(x <= 4.179457532768889e-37))) {
tmp = ((double) fabs(((double) ((4.0 / y) + ((double) ((x / y) * ((double) (1.0 - z))))))));
} else {
tmp = ((double) fabs((((double) (((double) (x + 4.0)) - ((double) (x * z)))) / y)));
}
return tmp;
}



Bits error versus x



Bits error versus y



Bits error versus z
Results
if x < -1.99969853520502311e108 or 4.1794575327688886e-37 < x Initial program 0.1
Taylor expanded around 0 9.5
Simplified0.1
if -1.99969853520502311e108 < x < 4.1794575327688886e-37Initial program 2.3
Simplified0.4
Final simplification0.3
herbie shell --seed 2020204
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))