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



Bits error versus x



Bits error versus y



Bits error versus z
Results
if x < -1.06347060619272826e39Initial program 0.1
rmApplied div-inv_binary640.1
Applied associate-*l*_binary640.1
Simplified0.1
if -1.06347060619272826e39 < x < 3.86691604845725504e58Initial program 2.2
Simplified0.3
if 3.86691604845725504e58 < x Initial program 0.1
rmApplied div-inv_binary640.2
Applied associate-*l*_binary640.2
Final simplification0.2
herbie shell --seed 2021118
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))