\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\begin{array}{l}
\mathbf{if}\;x \leq -9.87444019119289 \cdot 10^{-29}:\\
\;\;\;\;\left|\frac{x + 4}{y} - x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \leq 2.2116846177386437 \cdot 10^{-13}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y} + \frac{x}{y} \cdot \left(1 - z\right)\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 -9.87444019119289e-29)
(fabs (- (/ (+ x 4.0) y) (* x (/ z y))))
(if (<= x 2.2116846177386437e-13)
(fabs (/ (- (+ x 4.0) (* x z)) y))
(fabs (+ (/ 4.0 y) (* (/ x y) (- 1.0 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 (x <= -9.87444019119289e-29) {
tmp = fabs(((x + 4.0) / y) - (x * (z / y)));
} else if (x <= 2.2116846177386437e-13) {
tmp = fabs(((x + 4.0) - (x * z)) / y);
} else {
tmp = fabs((4.0 / y) + ((x / y) * (1.0 - z)));
}
return tmp;
}



Bits error versus x



Bits error versus y



Bits error versus z
Results
if x < -9.87444019119289e-29Initial program 0.2
rmApplied div-inv_binary64_4200.2
Applied associate-*l*_binary64_3640.3
Simplified0.2
if -9.87444019119289e-29 < x < 2.21168461773864368e-13Initial program 2.8
Simplified0.1
if 2.21168461773864368e-13 < x Initial program 0.1
Taylor expanded around 0 7.4
Simplified0.1
Final simplification0.1
herbie shell --seed 2020281
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))