\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\]
↓
\[\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+84} \lor \neg \left(y \leq 10^{-89}\right):\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y}, \frac{-4 - x}{y}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 + x \cdot \left(1 - z\right)}{y}\right|\\
\end{array}
\]
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
↓
(FPCore (x y z)
:precision binary64
(if (or (<= y -4e+84) (not (<= y 1e-89)))
(fabs (fma x (/ z y) (/ (- -4.0 x) y)))
(fabs (/ (+ 4.0 (* x (- 1.0 z))) 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 tmp;
if ((y <= -4e+84) || !(y <= 1e-89)) {
tmp = fabs(fma(x, (z / y), ((-4.0 - x) / y)));
} else {
tmp = fabs(((4.0 + (x * (1.0 - z))) / y));
}
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)
tmp = 0.0
if ((y <= -4e+84) || !(y <= 1e-89))
tmp = abs(fma(x, Float64(z / y), Float64(Float64(-4.0 - x) / y)));
else
tmp = abs(Float64(Float64(4.0 + Float64(x * Float64(1.0 - z))) / y));
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_] := If[Or[LessEqual[y, -4e+84], N[Not[LessEqual[y, 1e-89]], $MachinePrecision]], N[Abs[N[(x * N[(z / y), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(4.0 + N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]]
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
↓
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+84} \lor \neg \left(y \leq 10^{-89}\right):\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y}, \frac{-4 - x}{y}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 + x \cdot \left(1 - z\right)}{y}\right|\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.2 |
|---|
| Cost | 8649 |
|---|
\[\begin{array}{l}
t_0 := \frac{x + 4}{y} - z \cdot \frac{x}{y}\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+33} \lor \neg \left(t_0 \leq 2 \cdot 10^{-63}\right):\\
\;\;\;\;\left|t_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 + x \cdot \left(1 - z\right)}{y}\right|\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 20.9 |
|---|
| Cost | 7381 |
|---|
\[\begin{array}{l}
t_0 := \left|\frac{x}{y}\right|\\
t_1 := \left|z \cdot \frac{x}{y}\right|\\
\mathbf{if}\;x \leq -9.8 \cdot 10^{+145}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-36}:\\
\;\;\;\;\frac{4}{\left|y\right|}\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{+122} \lor \neg \left(x \leq 4.5 \cdot 10^{+269}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 20.8 |
|---|
| Cost | 7380 |
|---|
\[\begin{array}{l}
t_0 := \left|\frac{x}{y}\right|\\
t_1 := \left|z \cdot \frac{x}{y}\right|\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+148}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-12}:\\
\;\;\;\;\frac{4}{\left|y\right|}\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+120}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+267}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.3 |
|---|
| Cost | 7369 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+45} \lor \neg \left(y \leq 4.5 \cdot 10^{-91}\right):\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}} + \frac{-4 - x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 + x \cdot \left(1 - z\right)}{y}\right|\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 12.3 |
|---|
| Cost | 7248 |
|---|
\[\begin{array}{l}
t_0 := \left|z \cdot \frac{x}{y}\right|\\
t_1 := \left|\frac{x + 4}{y}\right|\\
\mathbf{if}\;z \leq -1.18 \cdot 10^{+107}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+43}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+54}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+189}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 8.7 |
|---|
| Cost | 7113 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2700000 \lor \neg \left(x \leq 22500000000\right):\\
\;\;\;\;\left|\frac{x}{y} \cdot \left(z + -1\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y}\right|\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 1.0 |
|---|
| Cost | 7113 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \lor \neg \left(x \leq 4.6\right):\\
\;\;\;\;\left|\frac{x}{y} \cdot \left(z + -1\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 - x \cdot z}{y}\right|\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 1.9 |
|---|
| Cost | 7108 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.15 \cdot 10^{+44}:\\
\;\;\;\;\left|\frac{4 + x \cdot \left(1 - z\right)}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y} \cdot \left(z + -1\right)\right|\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 19.0 |
|---|
| Cost | 6857 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \lor \neg \left(x \leq 4\right):\\
\;\;\;\;\left|\frac{x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{4}{\left|y\right|}\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 32.6 |
|---|
| Cost | 6592 |
|---|
\[\frac{4}{\left|y\right|}
\]