\[x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\]
↓
\[\begin{array}{l}
t_0 := x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-29} \lor \neg \left(t_0 \leq 10^{+226}\right):\\
\;\;\;\;\mathsf{fma}\left(y + -1, x \cdot z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* (- 1.0 y) z))))
↓
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- 1.0 (* (- 1.0 y) z)))))
(if (or (<= t_0 -1e-29) (not (<= t_0 1e+226)))
(fma (+ y -1.0) (* x z) x)
t_0)))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 = x * (1.0 - ((1.0 - y) * z));
double tmp;
if ((t_0 <= -1e-29) || !(t_0 <= 1e+226)) {
tmp = fma((y + -1.0), (x * z), x);
} else {
tmp = t_0;
}
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(x * Float64(1.0 - Float64(Float64(1.0 - y) * z)))
tmp = 0.0
if ((t_0 <= -1e-29) || !(t_0 <= 1e+226))
tmp = fma(Float64(y + -1.0), Float64(x * z), x);
else
tmp = t_0;
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[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -1e-29], N[Not[LessEqual[t$95$0, 1e+226]], $MachinePrecision]], N[(N[(y + -1.0), $MachinePrecision] * N[(x * z), $MachinePrecision] + x), $MachinePrecision], t$95$0]]
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
↓
\begin{array}{l}
t_0 := x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-29} \lor \neg \left(t_0 \leq 10^{+226}\right):\\
\;\;\;\;\mathsf{fma}\left(y + -1, x \cdot z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 99.7% |
|---|
| Cost | 1353 |
|---|
\[\begin{array}{l}
t_0 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 4 \cdot 10^{+303}\right):\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - t_0\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 99.7% |
|---|
| Cost | 1352 |
|---|
\[\begin{array}{l}
t_0 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+128}:\\
\;\;\;\;x \cdot \left(1 - t_0\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \left(x \cdot \left(1 - y\right)\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 84.5% |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_0 := y \cdot \left(x \cdot z\right)\\
t_1 := x - x \cdot z\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{+137}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{+94}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{+40}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 66.6% |
|---|
| Cost | 716 |
|---|
\[\begin{array}{l}
t_0 := y \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -5.15 \cdot 10^{-11}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+104}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-z\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 66.4% |
|---|
| Cost | 716 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.38 \cdot 10^{-11}:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-17}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+104}:\\
\;\;\;\;z \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-z\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 95.0% |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -440000000 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;x + z \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot z\\
\end{array}
\]
| Alternative 7 |
|---|
| Accuracy | 95.1% |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -440000000:\\
\;\;\;\;x + z \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;x - x \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(y \cdot z\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Accuracy | 65.2% |
|---|
| Cost | 521 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -100000000 \lor \neg \left(z \leq 1.12 \cdot 10^{+15}\right):\\
\;\;\;\;x \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 9 |
|---|
| Accuracy | 39.5% |
|---|
| Cost | 64 |
|---|
\[x
\]