\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\]
↓
\[\left(y + z\right) \cdot x + \mathsf{fma}\left(5, y, \left(y + \left(t + z\right)\right) \cdot x\right)
\]
(FPCore (x y z t)
:precision binary64
(+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
↓
(FPCore (x y z t)
:precision binary64
(+ (* (+ y z) x) (fma 5.0 y (* (+ y (+ t z)) x))))
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 ((y + z) * x) + fma(5.0, y, ((y + (t + z)) * x));
}
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 Float64(Float64(Float64(y + z) * x) + fma(5.0, y, Float64(Float64(y + Float64(t + z)) * x)))
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[(N[(N[(y + z), $MachinePrecision] * x), $MachinePrecision] + N[(5.0 * y + N[(N[(y + N[(t + z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
↓
\left(y + z\right) \cdot x + \mathsf{fma}\left(5, y, \left(y + \left(t + z\right)\right) \cdot x\right)
Alternatives
| Alternative 1 |
|---|
| Error | 0.1 |
|---|
| Cost | 7104 |
|---|
\[\mathsf{fma}\left(2 \cdot \left(z + y\right) + t, x, 5 \cdot y\right)
\]
| Alternative 2 |
|---|
| Error | 34.3 |
|---|
| Cost | 1376 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(y + y\right)\\
\mathbf{if}\;x \leq -2.2 \cdot 10^{+101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.7 \cdot 10^{+62}:\\
\;\;\;\;t \cdot x\\
\mathbf{elif}\;x \leq -2.5:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -7.4 \cdot 10^{-121}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-179}:\\
\;\;\;\;\left(2 \cdot z\right) \cdot x\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-24}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+52}:\\
\;\;\;\;t \cdot x\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+191}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot x\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 25.4 |
|---|
| Cost | 1372 |
|---|
\[\begin{array}{l}
t_1 := \left(2 \cdot x + 5\right) \cdot y\\
t_2 := x \cdot \left(2 \cdot y + t\right)\\
t_3 := x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-269}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-144}:\\
\;\;\;\;\left(2 \cdot z\right) \cdot x\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-93}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 10^{-51}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-27}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 17.9 |
|---|
| Cost | 1240 |
|---|
\[\begin{array}{l}
t_1 := t \cdot x + y \cdot 5\\
t_2 := x \cdot \left(2 \cdot y + t\right)\\
t_3 := \left(2 \cdot z + t\right) \cdot x\\
\mathbf{if}\;x \leq -2.5:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.12 \cdot 10^{-121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-169}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.85 \cdot 10^{+72}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+170}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 32.9 |
|---|
| Cost | 1112 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(y + y\right)\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -9 \cdot 10^{+63}:\\
\;\;\;\;t \cdot x\\
\mathbf{elif}\;x \leq -2.5:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-24}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+53}:\\
\;\;\;\;t \cdot x\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+192}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot x\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 11.0 |
|---|
| Cost | 1104 |
|---|
\[\begin{array}{l}
t_1 := t \cdot x + y \cdot 5\\
t_2 := \left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{-7}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-169}:\\
\;\;\;\;\left(2 \cdot z + t\right) \cdot x\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 10.0 |
|---|
| Cost | 1104 |
|---|
\[\begin{array}{l}
t_1 := \left(z + z\right) \cdot x + y \cdot 5\\
t_2 := \left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\
\mathbf{if}\;x \leq -4.6 \cdot 10^{-10}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-37}:\\
\;\;\;\;t \cdot x + y \cdot 5\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 0.8 |
|---|
| Cost | 1096 |
|---|
\[\begin{array}{l}
t_1 := \left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\
\mathbf{if}\;x \leq -2.5:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.58 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \left(\left(\left(z + z\right) + y\right) + t\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 27.6 |
|---|
| Cost | 976 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.12 \cdot 10^{-121}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-179}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-31}:\\
\;\;\;\;5 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 27.8 |
|---|
| Cost | 976 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(2 \cdot y + t\right)\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.12 \cdot 10^{-121}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-179}:\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-24}:\\
\;\;\;\;5 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\]
| Alternative 12 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[\left(2 \cdot z + t\right) \cdot x + \left(2 \cdot x + 5\right) \cdot y
\]
| Alternative 13 |
|---|
| Error | 14.7 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_1 := \left(2 \cdot x + 5\right) \cdot y\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 10^{-9}:\\
\;\;\;\;\left(2 \cdot z + t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 32.5 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{-7}:\\
\;\;\;\;t \cdot x\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-24}:\\
\;\;\;\;5 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t \cdot x\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 39.1 |
|---|
| Cost | 192 |
|---|
\[5 \cdot y
\]