\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\begin{array}{l}
t_0 := \frac{x + 4}{y}\\
\mathbf{if}\;x \leq -5.654014599181771 \cdot 10^{-9}:\\
\;\;\;\;\left|t_0 - x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \leq 8.95711979789483 \cdot 10^{-75}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, 1 - z, 4\right) \cdot \frac{1}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t_0 - z \cdot \frac{x}{y}\right|\\
\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 (/ (+ x 4.0) y)))
(if (<= x -5.654014599181771e-9)
(fabs (- t_0 (* x (/ z y))))
(if (<= x 8.95711979789483e-75)
(fabs (* (fma x (- 1.0 z) 4.0) (/ 1.0 y)))
(fabs (- t_0 (* z (/ x 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 t_0 = (x + 4.0) / y;
double tmp;
if (x <= -5.654014599181771e-9) {
tmp = fabs(t_0 - (x * (z / y)));
} else if (x <= 8.95711979789483e-75) {
tmp = fabs(fma(x, (1.0 - z), 4.0) * (1.0 / y));
} else {
tmp = fabs(t_0 - (z * (x / y)));
}
return tmp;
}



Bits error versus x



Bits error versus y



Bits error versus z
if x < -5.6540145991817714e-9Initial program 0.1
Applied div-inv_binary640.2
Applied associate-*l*_binary640.2
Simplified0.2
if -5.6540145991817714e-9 < x < 8.9571197978948292e-75Initial program 2.8
Applied div-inv_binary642.8
Applied associate-*l*_binary645.7
Simplified5.7
Taylor expanded in x around 0 0.1
Simplified0.1
Applied div-inv_binary640.1
if 8.9571197978948292e-75 < x Initial program 0.3
Final simplification0.2
herbie shell --seed 2021275
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))