(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 (<= (fabs (- t_0 (* (/ x y) z))) 5e-163)
(fabs (/ (fma x (- 1.0 z) 4.0) y))
(fabs (- t_0 (/ z (/ y x)))))))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 (fabs((t_0 - ((x / y) * z))) <= 5e-163) {
tmp = fabs((fma(x, (1.0 - z), 4.0) / y));
} else {
tmp = fabs((t_0 - (z / (y / x))));
}
return tmp;
}
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function code(x, y, z) t_0 = Float64(Float64(x + 4.0) / y) tmp = 0.0 if (abs(Float64(t_0 - Float64(Float64(x / y) * z))) <= 5e-163) tmp = abs(Float64(fma(x, Float64(1.0 - z), 4.0) / y)); else tmp = abs(Float64(t_0 - Float64(z / Float64(y / x)))); end return tmp end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[N[Abs[N[(t$95$0 - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 5e-163], N[Abs[N[(N[(x * N[(1.0 - z), $MachinePrecision] + 4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$0 - N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\begin{array}{l}
t_0 := \frac{x + 4}{y}\\
\mathbf{if}\;\left|t_0 - \frac{x}{y} \cdot z\right| \leq 5 \cdot 10^{-163}:\\
\;\;\;\;\left|\frac{\mathsf{fma}\left(x, 1 - z, 4\right)}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t_0 - \frac{z}{\frac{y}{x}}\right|\\
\end{array}



Bits error versus x



Bits error versus y



Bits error versus z
if (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))) < 4.99999999999999977e-163Initial program 8.3
Applied egg-rr8.7
Taylor expanded in x around 0 0.1
Simplified0.1
if 4.99999999999999977e-163 < (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))) Initial program 0.4
Applied egg-rr0.5
Final simplification0.5
herbie shell --seed 2022156
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))