\[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(2 \cdot \left(y + z\right) + 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 (+ (* 2.0 (+ y z)) 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 * ((2.0 * (y + z)) + 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(2.0 * Float64(y + z)) + 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[(2.0 * N[(y + z), $MachinePrecision]), $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(2 \cdot \left(y + z\right) + t\right)\right)
Alternatives
| Alternative 1 |
|---|
| Error | 0.1 |
|---|
| Cost | 7104 |
|---|
\[\mathsf{fma}\left(x, 2 \cdot \left(y + z\right) + t, y \cdot 5\right)
\]
| Alternative 2 |
|---|
| Error | 35.3 |
|---|
| Cost | 1772 |
|---|
\[\begin{array}{l}
t_1 := \left(2 \cdot z\right) \cdot x\\
t_2 := y \cdot \left(5 + x\right)\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+116}:\\
\;\;\;\;t \cdot x\\
\mathbf{elif}\;t \leq -8.2 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{-53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -6.5 \cdot 10^{-70}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-87}:\\
\;\;\;\;\left(2 \cdot x\right) \cdot y\\
\mathbf{elif}\;t \leq -3 \cdot 10^{-204}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-242}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 8.1 \cdot 10^{-199}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-31}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+151}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot x\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 25.5 |
|---|
| Cost | 1108 |
|---|
\[\begin{array}{l}
t_1 := \left(2 \cdot y + t\right) \cdot x\\
t_2 := \left(2 \cdot \left(z + y\right)\right) \cdot x\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+133}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -0.0135:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-17}:\\
\;\;\;\;y \cdot \left(5 + x\right)\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+95}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 6.7 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 9.3 |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
t_1 := t \cdot x + \left(2 \cdot x + 5\right) \cdot y\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{-90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-8}:\\
\;\;\;\;\left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 0.6 |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
t_1 := \left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\
\mathbf{if}\;x \leq -6500:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.5:\\
\;\;\;\;x \cdot \left(z \cdot 2 + t\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 0.6 |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -6500:\\
\;\;\;\;\left(2 \cdot z + y\right) \cdot x + \left(y + t\right) \cdot x\\
\mathbf{elif}\;x \leq 2.5:\\
\;\;\;\;x \cdot \left(z \cdot 2 + t\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;\left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[\left(2 \cdot z + t\right) \cdot x + \left(2 \cdot x + 5\right) \cdot y
\]
| Alternative 8 |
|---|
| Error | 12.3 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
t_1 := \left(5 - -2 \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -1200000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 0.00022:\\
\;\;\;\;\left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 9.4 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
t_1 := \left(t + 2 \cdot \left(y + z\right)\right) \cdot x\\
\mathbf{if}\;x \leq -0.042:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{-23}:\\
\;\;\;\;5 \cdot y + \left(y + t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 0.1 |
|---|
| Cost | 832 |
|---|
\[\left(2 \cdot \left(y + z\right) + t\right) \cdot x + y \cdot 5
\]
| Alternative 11 |
|---|
| Error | 25.5 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_1 := \left(2 \cdot \left(z + y\right)\right) \cdot x\\
\mathbf{if}\;x \leq -0.042:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-16}:\\
\;\;\;\;y \cdot \left(5 + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 18.2 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(5 + x\right)\\
\mathbf{if}\;y \leq -2600000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 0.00025:\\
\;\;\;\;\left(2 \cdot z + t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 14.1 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_1 := \left(5 - -2 \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -0.28:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 0.00031:\\
\;\;\;\;\left(2 \cdot z + t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 31.2 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(5 + x\right)\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{-112}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 0.00013:\\
\;\;\;\;t \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 31.9 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-91}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 0.00014:\\
\;\;\;\;t \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 46.7 |
|---|
| Cost | 192 |
|---|
\[t \cdot x
\]