\[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 | 33.9 |
|---|
| Cost | 1508 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
t_2 := z \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+141}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -1.0553992558608906 \cdot 10^{-71}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.898276757502309 \cdot 10^{-124}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.112528506255057 \cdot 10^{-125}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.92351541277789 \cdot 10^{-94}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 1.9553227416084183 \cdot 10^{-75}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 5749.860309125221:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+144}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 23.0 |
|---|
| Cost | 1372 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
t_2 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;x \leq -2.15 \cdot 10^{+141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{+85}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq -3.898276757502309 \cdot 10^{-124}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.991804369666201 \cdot 10^{-144}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.92351541277789 \cdot 10^{-94}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.9553227416084183 \cdot 10^{-75}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 5749.860309125221:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 11.0 |
|---|
| Cost | 1360 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\
\mathbf{if}\;x \leq -8.715254566785824 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.3344253483317512 \cdot 10^{-126}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 5.319790113995197 \cdot 10^{-104}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 0.00037907154916533525:\\
\;\;\;\;z \cdot \left(x \cdot 2\right) + y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 24.1 |
|---|
| Cost | 1108 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;x \leq -3.898276757502309 \cdot 10^{-124}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.991804369666201 \cdot 10^{-144}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.92351541277789 \cdot 10^{-94}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.9553227416084183 \cdot 10^{-75}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 5.9 \cdot 10^{+144}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 23.2 |
|---|
| Cost | 1108 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;x \leq -3.898276757502309 \cdot 10^{-124}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.991804369666201 \cdot 10^{-144}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.92351541277789 \cdot 10^{-94}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.9553227416084183 \cdot 10^{-75}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+143}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 16.9 |
|---|
| Cost | 1108 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
t_2 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;x \leq -2.15 \cdot 10^{+141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{+85}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq -1.790296397342562 \cdot 10^{-96}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.9553227416084183 \cdot 10^{-75}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 5749.860309125221:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 15.2 |
|---|
| Cost | 1104 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -2.9079384283436724 \cdot 10^{+128}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8.083104498388488 \cdot 10^{+96}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq -2.733933434286533 \cdot 10^{-148}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 602641152.3689288:\\
\;\;\;\;2 \cdot \left(x \cdot z\right) + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 11.1 |
|---|
| Cost | 1104 |
|---|
\[\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)\\
\mathbf{if}\;x \leq -8.715254566785824 \cdot 10^{-119}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.3344253483317512 \cdot 10^{-126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.319790113995197 \cdot 10^{-104}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 1.192279306485456 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 33.5 |
|---|
| Cost | 984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+141}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -1.0553992558608906 \cdot 10^{-71}:\\
\;\;\;\;z \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;x \leq -3.898276757502309 \cdot 10^{-124}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.112528506255057 \cdot 10^{-125}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.92351541277789 \cdot 10^{-94}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 1.192279306485456 \cdot 10^{-45}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 15.2 |
|---|
| 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 -2.9079384283436724 \cdot 10^{+128}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -8.083104498388488 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.733933434286533 \cdot 10^{-148}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 602641152.3689288:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[\left(x \cdot \left(\left(y + z\right) \cdot 2\right) + x \cdot t\right) + y \cdot 5
\]
| Alternative 12 |
|---|
| Error | 10.7 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\\
\mathbf{if}\;x \leq -1.790296397342562 \cdot 10^{-96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.9553227416084183 \cdot 10^{-75}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 33.5 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.898276757502309 \cdot 10^{-124}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.112528506255057 \cdot 10^{-125}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.92351541277789 \cdot 10^{-94}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 1.192279306485456 \cdot 10^{-45}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 38.1 |
|---|
| Cost | 192 |
|---|
\[y \cdot 5
\]