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



Bits error versus x



Bits error versus y



Bits error versus z
Results
if (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))) < 1.7334087540291929e-55Initial program 5.2
Taylor expanded in x around 0 0.1
if 1.7334087540291929e-55 < (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))) Initial program 0.1
Final simplification0.1
herbie shell --seed 2021313
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))