(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 (<= y -1e-22)
(fabs (- t_0 (* x (/ z y))))
(if (<= y 1e-150)
(fabs (pow (/ y (- (fma x z -4.0) x)) -1.0))
(fabs (- t_0 (/ x (/ y 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 t_0 = (x + 4.0) / y;
double tmp;
if (y <= -1e-22) {
tmp = fabs((t_0 - (x * (z / y))));
} else if (y <= 1e-150) {
tmp = fabs(pow((y / (fma(x, z, -4.0) - x)), -1.0));
} else {
tmp = fabs((t_0 - (x / (y / z))));
}
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 (y <= -1e-22) tmp = abs(Float64(t_0 - Float64(x * Float64(z / y)))); elseif (y <= 1e-150) tmp = abs((Float64(y / Float64(fma(x, z, -4.0) - x)) ^ -1.0)); else tmp = abs(Float64(t_0 - Float64(x / Float64(y / z)))); 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[y, -1e-22], N[Abs[N[(t$95$0 - N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 1e-150], N[Abs[N[Power[N[(y / N[(N[(x * z + -4.0), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$0 - N[(x / N[(y / z), $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}\;y \leq -1 \cdot 10^{-22}:\\
\;\;\;\;\left|t_0 - x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;y \leq 10^{-150}:\\
\;\;\;\;\left|{\left(\frac{y}{\mathsf{fma}\left(x, z, -4\right) - x}\right)}^{-1}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t_0 - \frac{x}{\frac{y}{z}}\right|\\
\end{array}
if y < -1e-22Initial program 2.2
Applied egg-rr0.1
Applied egg-rr0.2
if -1e-22 < y < 1.00000000000000001e-150Initial program 0.1
Simplified0.1
Applied egg-rr0.1
if 1.00000000000000001e-150 < y Initial program 2.0
Applied egg-rr1.2
Final simplification0.6
herbie shell --seed 2022192
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))