\[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 |
|---|
| Error | 0.1 |
|---|
| Cost | 7104 |
|---|
\[\mathsf{fma}\left(\left(y + z\right) \cdot 2 + t, x, y \cdot 5\right)
\]
| Alternative 2 |
|---|
| Error | 33.4 |
|---|
| Cost | 1380 |
|---|
\[\begin{array}{l}
t_1 := z \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;y \leq -6.6 \cdot 10^{+171}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -8.6 \cdot 10^{+141}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;y \leq -6.857707392897386 \cdot 10^{+59}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -4466052778300237000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.8693927057562255 \cdot 10^{-19}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -2.208063290084773 \cdot 10^{-82}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq -2.3287888846806855 \cdot 10^{-96}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 1.6872565259915895 \cdot 10^{-184}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.573200644390177 \cdot 10^{-15}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 20.0 |
|---|
| Cost | 1240 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;y \leq -6.6 \cdot 10^{+171}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -8.6 \cdot 10^{+141}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;y \leq -6.857707392897386 \cdot 10^{+59}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -4466052778300237000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7.326893248254141 \cdot 10^{-9}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 4.971356079521299 \cdot 10^{+24}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 20.1 |
|---|
| Cost | 1240 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;y \leq -6.6 \cdot 10^{+171}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{+133}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;y \leq -6.857707392897386 \cdot 10^{+59}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -4466052778300237000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7.326893248254141 \cdot 10^{-9}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 4.971356079521299 \cdot 10^{+24}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 15.5 |
|---|
| Cost | 1240 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
t_3 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;y \leq -6.857707392897386 \cdot 10^{+59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4466052778300237000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.6432139544644515 \cdot 10^{-60}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 1.6872565259915895 \cdot 10^{-184}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.3735017161368545 \cdot 10^{-71}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 4.971356079521299 \cdot 10^{+24}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 9.8 |
|---|
| Cost | 1236 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\
t_3 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;x \leq -7.967679231863752 \cdot 10^{-8}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -5.340763113667047 \cdot 10^{-235}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.1366297399494267 \cdot 10^{-136}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 2.7370733649823096 \cdot 10^{-90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.380053297819964 \cdot 10^{-58}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 32.7 |
|---|
| Cost | 1116 |
|---|
\[\begin{array}{l}
t_1 := z \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;y \leq -6.857707392897386 \cdot 10^{+59}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -4466052778300237000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.8693927057562255 \cdot 10^{-19}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -2.208063290084773 \cdot 10^{-82}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq -2.3287888846806855 \cdot 10^{-96}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 1.6872565259915895 \cdot 10^{-184}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.573200644390177 \cdot 10^{-15}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 14.8 |
|---|
| Cost | 976 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -6.857707392897386 \cdot 10^{+59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4466052778300237000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.8693927057562255 \cdot 10^{-19}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.971356079521299 \cdot 10^{+24}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 8.4 |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -8.415341302626598 \cdot 10^{+111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.646869915931763 \cdot 10^{+89}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right)
\]
| Alternative 11 |
|---|
| Error | 9.7 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\
\mathbf{if}\;x \leq -5.336571372234044 \cdot 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.380053297819964 \cdot 10^{-58}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 35.1 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{+165}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq 1.240265539428813 \cdot 10^{-8}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 38.6 |
|---|
| Cost | 192 |
|---|
\[y \cdot 5
\]