\[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 | 27.0 |
|---|
| Cost | 1504 |
|---|
\[\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
t_2 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -30:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-85}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-110}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-139}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-55}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 10.2 |
|---|
| Cost | 1368 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
t_3 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;x \leq -2 \cdot 10^{-84}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-240}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{-160}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-51}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 10.3 |
|---|
| Cost | 1368 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
t_3 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{-86}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-243}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-160}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-50}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-27}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 10.3 |
|---|
| Cost | 1368 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := \left(y + z\right) \cdot 2\\
t_3 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;x \leq -4.1 \cdot 10^{-84}:\\
\;\;\;\;x \cdot t_2 + x \cdot t\\
\mathbf{elif}\;x \leq 1.08 \cdot 10^{-244}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{-160}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{-54}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-31}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + t_2\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 10.2 |
|---|
| Cost | 1368 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := \left(y + z\right) \cdot 2\\
\mathbf{if}\;x \leq -5 \cdot 10^{-85}:\\
\;\;\;\;x \cdot t_2 + x \cdot t\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-246}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-160}:\\
\;\;\;\;x \cdot \left(y + t\right) + \left(y \cdot 5 + y \cdot x\right)\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-52}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-29}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + t_2\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right)
\]
| Alternative 7 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[y \cdot 5 + \left(x \cdot \left(\left(y + z\right) \cdot 2\right) + x \cdot t\right)
\]
| Alternative 8 |
|---|
| Error | 33.0 |
|---|
| Cost | 852 |
|---|
\[\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{+21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -800:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-139}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-27}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 22.9 |
|---|
| Cost | 845 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-147} \lor \neg \left(x \leq 2.6 \cdot 10^{-55}\right):\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 17.6 |
|---|
| Cost | 845 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-139} \lor \neg \left(x \leq 4.5 \cdot 10^{-55}\right):\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 11.3 |
|---|
| Cost | 841 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{-139} \lor \neg \left(x \leq 2.5 \cdot 10^{-55}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 27.1 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{-139}:\\
\;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-54}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 32.1 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-84}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-31}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 33.2 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-145}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-31}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 46.8 |
|---|
| Cost | 192 |
|---|
\[x \cdot t
\]