\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\]
↓
\[\mathsf{fma}\left(y, 5, x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\right)
\]
(FPCore (x y z t)
:precision binary64
(+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
↓
(FPCore (x y z t) :precision binary64 (fma y 5.0 (* x (+ (* (+ y z) 2.0) t))))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
↓
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * (((y + z) * 2.0) + t)));
}
function code(x, y, z, t)
return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0))
end
↓
function code(x, y, z, t)
return fma(y, 5.0, Float64(x * Float64(Float64(Float64(y + z) * 2.0) + t)))
end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
↓
\mathsf{fma}\left(y, 5, x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\right)
Alternatives
| Alternative 1 |
|---|
| Accuracy | 77.6% |
|---|
| Cost | 1108 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.32 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.3 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-41}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-103}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq 0.0075:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 77.6% |
|---|
| Cost | 1108 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-41}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 7.7 \cdot 10^{-106}:\\
\;\;\;\;x \cdot \left(z + z\right) + x \cdot t\\
\mathbf{elif}\;y \leq 0.055:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 92.3% |
|---|
| Cost | 1097 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -36000000000000 \lor \neg \left(y \leq 3\right):\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + \left(x \cdot \left(z + z\right) + x \cdot t\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 58.7% |
|---|
| Cost | 976 |
|---|
\[\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-177}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 10^{-136}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-113}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 60.7% |
|---|
| Cost | 976 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-135}:\\
\;\;\;\;\left(y + z\right) \cdot \left(x + x\right)\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-113}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-108}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 83.7% |
|---|
| Cost | 969 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{-168} \lor \neg \left(y \leq 1.28 \cdot 10^{-110}\right):\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + z\right) + x \cdot t\\
\end{array}
\]
| Alternative 7 |
|---|
| Accuracy | 92.3% |
|---|
| Cost | 969 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -33000000000000 \lor \neg \left(y \leq 15\right):\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Accuracy | 99.9% |
|---|
| Cost | 960 |
|---|
\[y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right)
\]
| Alternative 9 |
|---|
| Accuracy | 99.9% |
|---|
| Cost | 960 |
|---|
\[\left(x \cdot \left(\left(y + z\right) \cdot 2\right) + x \cdot t\right) + y \cdot 5
\]
| Alternative 10 |
|---|
| Accuracy | 49.5% |
|---|
| Cost | 721 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -0.0009:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-40} \lor \neg \left(x \leq -9.5 \cdot 10^{-58}\right) \land x \leq 3.35 \cdot 10^{-28}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\]
| Alternative 11 |
|---|
| Accuracy | 49.5% |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-150}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-298}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-135}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-38}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 12 |
|---|
| Accuracy | 77.4% |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-42} \lor \neg \left(y \leq 1.1 \cdot 10^{-38}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\]
| Alternative 13 |
|---|
| Accuracy | 26.3% |
|---|
| Cost | 192 |
|---|
\[x \cdot t
\]