\[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\]
↓
\[\mathsf{fma}\left(5, y, 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 5.0 y (* 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(5.0, y, (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(5.0, y, 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[(5.0 * y + 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(5, y, x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\right)
Alternatives
| Alternative 1 |
|---|
| Error | 0.1 |
|---|
| Cost | 7104 |
|---|
\[\mathsf{fma}\left(x, \left(y + z\right) \cdot 2 + t, 5 \cdot y\right)
\]
| Alternative 2 |
|---|
| Error | 26.6 |
|---|
| Cost | 1372 |
|---|
\[\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{if}\;x \leq -0.07018784524049974:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.910038828991574 \cdot 10^{-38}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 8.649444893928671 \cdot 10^{-76}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq 1.3296886319608344 \cdot 10^{-56}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 8.314380142577797 \cdot 10^{-32}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 10^{+183}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 17.1 |
|---|
| Cost | 1372 |
|---|
\[\begin{array}{l}
t_1 := x \cdot t + 5 \cdot y\\
t_2 := 2 \cdot \left(x \cdot z\right) + 5 \cdot y\\
\mathbf{if}\;x \leq -63947608556.62092:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;x \leq -8.571435074495924 \cdot 10^{-109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.734036140664148 \cdot 10^{-182}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.970493994461763 \cdot 10^{-251}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.2414041701829899 \cdot 10^{-73}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.9757190850307673 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+81}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 9.5 |
|---|
| Cost | 1368 |
|---|
\[\begin{array}{l}
t_1 := x \cdot t + 5 \cdot y\\
t_2 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\
t_3 := 2 \cdot \left(x \cdot z\right) + 5 \cdot y\\
\mathbf{if}\;x \leq -0.07018784524049974:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -8.571435074495924 \cdot 10^{-109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.734036140664148 \cdot 10^{-182}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -3.970493994461763 \cdot 10^{-251}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.2414041701829899 \cdot 10^{-73}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 8.314380142577797 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 9.3 |
|---|
| Cost | 1368 |
|---|
\[\begin{array}{l}
t_1 := x \cdot t + 5 \cdot y\\
t_2 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\
t_3 := 2 \cdot \left(x \cdot z\right) + 5 \cdot y\\
\mathbf{if}\;x \leq -0.07018784524049974:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -8.571435074495924 \cdot 10^{-109}:\\
\;\;\;\;x \cdot t + y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{elif}\;x \leq -4.734036140664148 \cdot 10^{-182}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -3.970493994461763 \cdot 10^{-251}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.2414041701829899 \cdot 10^{-73}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 8.314380142577797 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 32.3 |
|---|
| Cost | 1112 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2064878861918055.5:\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\mathbf{elif}\;x \leq -1.910038828991574 \cdot 10^{-38}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 8.649444893928671 \cdot 10^{-76}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq 1.3296886319608344 \cdot 10^{-56}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 8.314380142577797 \cdot 10^{-32}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+105}:\\
\;\;\;\;z \cdot \left(x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 26.0 |
|---|
| Cost | 1108 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -1.910038828991574 \cdot 10^{-38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 8.649444893928671 \cdot 10^{-76}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq 1.3296886319608344 \cdot 10^{-56}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 8.314380142577797 \cdot 10^{-32}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+88}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 32.3 |
|---|
| Cost | 984 |
|---|
\[\begin{array}{l}
t_1 := z \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;y \leq -1796.943448307833:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;y \leq -5.060888449991652 \cdot 10^{-127}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq -2.852408274113357 \cdot 10^{-220}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 7.540491452358505 \cdot 10^{-264}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq 3.413598606064249 \cdot 10^{-132}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 412851.5591902805:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;5 \cdot y\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 1.1 |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\
\mathbf{if}\;x \leq -46991497894285.87:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.317623065941351 \cdot 10^{-12}:\\
\;\;\;\;5 \cdot y + x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[\left(x \cdot \left(\left(y + z\right) \cdot 2\right) + x \cdot t\right) + 5 \cdot y
\]
| Alternative 11 |
|---|
| Error | 17.7 |
|---|
| Cost | 844 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -63947608556.62092:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.9757190850307673 \cdot 10^{-24}:\\
\;\;\;\;x \cdot t + 5 \cdot y\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+88}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 17.5 |
|---|
| Cost | 844 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -63947608556.62092:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;x \leq 1.9757190850307673 \cdot 10^{-24}:\\
\;\;\;\;x \cdot t + 5 \cdot y\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+81}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 32.7 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.910038828991574 \cdot 10^{-38}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 8.649444893928671 \cdot 10^{-76}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq 1.3296886319608344 \cdot 10^{-56}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 8.314380142577797 \cdot 10^{-32}:\\
\;\;\;\;5 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 38.9 |
|---|
| Cost | 192 |
|---|
\[5 \cdot y
\]