\[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(t + \left(y + z\right) \cdot 2\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 (+ t (* (+ y z) 2.0)))))
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 * (t + ((y + z) * 2.0))));
}
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(t + Float64(Float64(y + z) * 2.0))))
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[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $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(t + \left(y + z\right) \cdot 2\right)\right)
Alternatives
| Alternative 1 |
|---|
| Error | 16.4 |
|---|
| Cost | 1372 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;t \leq -1.433755867923289 \cdot 10^{+76}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.452289457691771 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7.714399150639959 \cdot 10^{-121}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{elif}\;t \leq 9.265100117215702 \cdot 10^{-61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.410362952962034 \cdot 10^{+35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.4191626766661195 \cdot 10^{+48}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;t \leq 4.805112264034117 \cdot 10^{+72}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 16.4 |
|---|
| Cost | 1372 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;t \leq -1.433755867923289 \cdot 10^{+76}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.452289457691771 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7.714399150639959 \cdot 10^{-121}:\\
\;\;\;\;y \cdot 5 + y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;t \leq 9.265100117215702 \cdot 10^{-61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.410362952962034 \cdot 10^{+35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.4191626766661195 \cdot 10^{+48}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;t \leq 4.805112264034117 \cdot 10^{+72}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 27.4 |
|---|
| Cost | 1108 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -3.378035299059156 \cdot 10^{-72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.186029536434914 \cdot 10^{-113}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 4.680895701701483 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.977862782028542 \cdot 10^{-19}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 5500000000000:\\
\;\;\;\;x \cdot \left(z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 15.8 |
|---|
| Cost | 976 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -4.245648964463158 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.4636969468169236 \cdot 10^{-17}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq -4.706163679713545 \cdot 10^{-128}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{elif}\;y \leq 3.307153294452222 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 10.2 |
|---|
| Cost | 972 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -3.378035299059156 \cdot 10^{-72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.478600973061447 \cdot 10^{-197}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 7.977862782028542 \cdot 10^{-19}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 9.6 |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;t \leq -1.433755867923289 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.265100117215702 \cdot 10^{-61}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[x \cdot \left(t + z \cdot 2\right) + y \cdot \left(5 + x \cdot 2\right)
\]
| Alternative 8 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) + y \cdot 5
\]
| Alternative 9 |
|---|
| Error | 33.1 |
|---|
| Cost | 852 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(z \cdot 2\right)\\
\mathbf{if}\;y \leq -1.1946151379230837 \cdot 10^{+53}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -8.287426312195098 \cdot 10^{-116}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.507721912982044 \cdot 10^{-211}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq -1.2256823179304415 \cdot 10^{-288}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.7481363253719933 \cdot 10^{-45}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 19.5 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.1946151379230837 \cdot 10^{+53}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 5.116528806224703 \cdot 10^{+57}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 15.1 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.1946151379230837 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.307153294452222 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 32.0 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.514595472517589 \cdot 10^{-12}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 2.7481363253719933 \cdot 10^{-45}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 38.7 |
|---|
| Cost | 192 |
|---|
\[y \cdot 5
\]