(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))) 2.5325668188506666e-100)
(fabs (- t_0 (/ x (/ y z))))
(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))) <= 2.5325668188506666e-100) {
tmp = fabs((t_0 - (x / (y / z))));
} else {
tmp = fabs((t_0 - (z / (y / x))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (x + 4.0d0) / y
if (abs((t_0 - ((x / y) * z))) <= 2.5325668188506666d-100) then
tmp = abs((t_0 - (x / (y / z))))
else
tmp = abs((t_0 - (z / (y / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
public static double code(double x, double y, double z) {
double t_0 = (x + 4.0) / y;
double tmp;
if (Math.abs((t_0 - ((x / y) * z))) <= 2.5325668188506666e-100) {
tmp = Math.abs((t_0 - (x / (y / z))));
} else {
tmp = Math.abs((t_0 - (z / (y / x))));
}
return tmp;
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
def code(x, y, z): t_0 = (x + 4.0) / y tmp = 0 if math.fabs((t_0 - ((x / y) * z))) <= 2.5325668188506666e-100: tmp = math.fabs((t_0 - (x / (y / z)))) else: tmp = math.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))) <= 2.5325668188506666e-100) tmp = abs(Float64(t_0 - Float64(x / Float64(y / z)))); else tmp = abs(Float64(t_0 - Float64(z / Float64(y / x)))); end return tmp end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
function tmp_2 = code(x, y, z) t_0 = (x + 4.0) / y; tmp = 0.0; if (abs((t_0 - ((x / y) * z))) <= 2.5325668188506666e-100) tmp = abs((t_0 - (x / (y / z)))); else tmp = abs((t_0 - (z / (y / x)))); end tmp_2 = 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], 2.5325668188506666e-100], N[Abs[N[(t$95$0 - N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]), $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 2.5325668188506666 \cdot 10^{-100}:\\
\;\;\;\;\left|t_0 - \frac{x}{\frac{y}{z}}\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
Results
if (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))) < 2.5325668188506666e-100Initial program 6.8
Applied egg-rr0.1
if 2.5325668188506666e-100 < (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))) Initial program 0.2
Applied egg-rr0.3
Final simplification0.3
herbie shell --seed 2022150
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))