\[x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\]
↓
\[\begin{array}{l}
t_0 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;t_0 \leq -4 \cdot 10^{+128}:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\mathbf{elif}\;t_0 \leq 10^{+276}:\\
\;\;\;\;x \cdot \left(1 - t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y + -1, z \cdot x, x\right)\\
\end{array}
\]
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* (- 1.0 y) z))))
↓
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- 1.0 y) z)))
(if (<= t_0 -4e+128)
(* z (- (* y x) x))
(if (<= t_0 1e+276) (* x (- 1.0 t_0)) (fma (+ y -1.0) (* z x) x)))))double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * z));
}
↓
double code(double x, double y, double z) {
double t_0 = (1.0 - y) * z;
double tmp;
if (t_0 <= -4e+128) {
tmp = z * ((y * x) - x);
} else if (t_0 <= 1e+276) {
tmp = x * (1.0 - t_0);
} else {
tmp = fma((y + -1.0), (z * x), x);
}
return tmp;
}
function code(x, y, z)
return Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z)))
end
↓
function code(x, y, z)
t_0 = Float64(Float64(1.0 - y) * z)
tmp = 0.0
if (t_0 <= -4e+128)
tmp = Float64(z * Float64(Float64(y * x) - x));
elseif (t_0 <= 1e+276)
tmp = Float64(x * Float64(1.0 - t_0));
else
tmp = fma(Float64(y + -1.0), Float64(z * x), x);
end
return tmp
end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$0, -4e+128], N[(z * N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+276], N[(x * N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(y + -1.0), $MachinePrecision] * N[(z * x), $MachinePrecision] + x), $MachinePrecision]]]]
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
↓
\begin{array}{l}
t_0 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;t_0 \leq -4 \cdot 10^{+128}:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\mathbf{elif}\;t_0 \leq 10^{+276}:\\
\;\;\;\;x \cdot \left(1 - t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y + -1, z \cdot x, x\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 98.8% |
|---|
| Cost | 1352 |
|---|
\[\begin{array}{l}
t_0 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;t_0 \leq -4 \cdot 10^{+128}:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+284}:\\
\;\;\;\;x \cdot \left(1 - t_0\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot x\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 66.5% |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_0 := x \cdot \left(-z\right)\\
t_1 := y \cdot \left(z \cdot x\right)\\
\mathbf{if}\;z \leq -2.95 \cdot 10^{+53}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+84}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 66.4% |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_0 := x \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -6.3 \cdot 10^{+59}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-6}:\\
\;\;\;\;z \cdot \left(y \cdot x\right)\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+83}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot x\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 86.0% |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -0.042 \lor \neg \left(z \leq 2.65 \cdot 10^{-5}\right):\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 98.4% |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -3 \lor \neg \left(z \leq 2.65 \cdot 10^{-5}\right):\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + y \cdot z\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 79.7% |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+180}:\\
\;\;\;\;y \cdot \left(z \cdot x\right)\\
\mathbf{elif}\;y \leq 72000:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot x\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Accuracy | 69.5% |
|---|
| Cost | 521 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 8 |
|---|
| Accuracy | 48.0% |
|---|
| Cost | 64 |
|---|
\[x
\]