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



Bits error versus x



Bits error versus y



Bits error versus z
if x < -3.79387588023225575e-50Initial program 0.3
Applied frac-2neg_binary640.3
Simplified0.3
if -3.79387588023225575e-50 < x < 48880875414.55884Initial program 2.7
Applied div-inv_binary642.7
Applied fma-neg_binary642.7
Taylor expanded in x around 0 0.1
Simplified0.1
Applied clear-num_binary640.1
if 48880875414.55884 < x Initial program 0.1
Taylor expanded in x around inf 0.4
Simplified0.3
Final simplification0.2
herbie shell --seed 2022019
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))