\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\begin{array}{l}
\mathbf{if}\;x \leq -1.6209712599203426 \cdot 10^{+31}:\\
\;\;\;\;\left|\frac{x}{y} \cdot \left(1 - z\right)\right|\\
\mathbf{elif}\;x \leq -3.864679112187972 \cdot 10^{-280}:\\
\;\;\;\;\left|\frac{x - \mathsf{fma}\left(x, z, -4\right)}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\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.6209712599203426e+31)
(fabs (* (/ x y) (- 1.0 z)))
(if (<= x -3.864679112187972e-280)
(fabs (/ (- x (fma x z -4.0)) y))
(fabs (- (/ (+ x 4.0) y) (* (/ x y) 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 <= -1.6209712599203426e+31) {
tmp = fabs((x / y) * (1.0 - z));
} else if (x <= -3.864679112187972e-280) {
tmp = fabs((x - fma(x, z, -4.0)) / y);
} else {
tmp = fabs(((x + 4.0) / y) - ((x / y) * z));
}
return tmp;
}



Bits error versus x



Bits error versus y



Bits error versus z
if x < -1.6209712599203426e31Initial program 0.1
Taylor expanded in x around inf 0.3
Simplified0.1
if -1.6209712599203426e31 < x < -3.8646791121879721e-280Initial program 2.5
Simplified0.1
if -3.8646791121879721e-280 < x Initial program 1.5
Applied clear-num_binary641.6
Taylor expanded in y around 0 1.5
Final simplification0.8
herbie shell --seed 2022081
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))