\[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 | 9.3 |
|---|
| Cost | 1364 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + x \cdot \left(t + y \cdot 2\right)\\
t_2 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\
t_3 := y \cdot 5 + \left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \leq -1.514742231343599 \cdot 10^{-35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.7094904081489346 \cdot 10^{-76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.2647753101705916 \cdot 10^{-136}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 2.223395081914315 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 11.456688281619728:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 9.3 |
|---|
| Cost | 1364 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\
t_2 := y \cdot 5 + \left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \leq -1.514742231343599 \cdot 10^{-35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.7094904081489346 \cdot 10^{-76}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;x \leq 1.2647753101705916 \cdot 10^{-136}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.223395081914315 \cdot 10^{-8}:\\
\;\;\;\;\left(x \cdot t + y \cdot 5\right) + 2 \cdot \left(y \cdot x\right)\\
\mathbf{elif}\;x \leq 11.456688281619728:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 12.9 |
|---|
| Cost | 1232 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+168}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\
\mathbf{elif}\;t \leq -8.161804625723824 \cdot 10^{+115}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{elif}\;t \leq -2.891370321032443 \cdot 10^{+88}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq 3.204229558822736 \cdot 10^{+136}:\\
\;\;\;\;y \cdot 5 + \left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[2 \cdot \left(x \cdot \left(y + z\right)\right) + \left(x \cdot t + y \cdot 5\right)
\]
| Alternative 5 |
|---|
| Error | 27.9 |
|---|
| Cost | 844 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -1.9703690152599765 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.1186784765445553 \cdot 10^{-44}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+141}:\\
\;\;\;\;z \cdot \left(x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 12.6 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -7.668617181410092 \cdot 10^{+81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.906836053666133 \cdot 10^{+38}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 34.7 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+168}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq -8.161804625723824 \cdot 10^{+115}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq -2.891370321032443 \cdot 10^{+88}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;t \leq 1.1488731676759713 \cdot 10^{+46}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 25.4 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.9703690152599765 \cdot 10^{-57}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;x \leq 1.1186784765445553 \cdot 10^{-44}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 19.3 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -7.668617181410092 \cdot 10^{+81}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 5.470246135702431 \cdot 10^{+34}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 14.8 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -8537115266251681:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.360258502393866 \cdot 10^{-70}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 32.2 |
|---|
| Cost | 588 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{+131}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;x \leq -1.9703690152599765 \cdot 10^{-57}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 5.963259965881587 \cdot 10^{-56}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 31.7 |
|---|
| Cost | 588 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -6.27233347512862 \cdot 10^{-33}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 3.312552422013941 \cdot 10^{-265}:\\
\;\;\;\;z \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;y \leq 2.0577775801244678 \cdot 10^{-23}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 47.0 |
|---|
| Cost | 192 |
|---|
\[x \cdot t
\]