\[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 | 15.4 |
|---|
| Cost | 1236 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.6943556747065267 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -9.211145413881336 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq -2.0999557055183067 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4939117274220489 \cdot 10^{-111}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right) + x \cdot t\\
\mathbf{elif}\;y \leq 8.932705139986231 \cdot 10^{+85}:\\
\;\;\;\;y \cdot 5 + z \cdot \left(x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 15.4 |
|---|
| Cost | 1236 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.6943556747065267 \cdot 10^{+52}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(y \cdot 2\right)\\
\mathbf{elif}\;y \leq -9.211145413881336 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq -2.0999557055183067 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4939117274220489 \cdot 10^{-111}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right) + x \cdot t\\
\mathbf{elif}\;y \leq 8.932705139986231 \cdot 10^{+85}:\\
\;\;\;\;y \cdot 5 + z \cdot \left(x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 16.3 |
|---|
| Cost | 1104 |
|---|
\[\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.6943556747065267 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -9.211145413881336 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq -2.0999557055183067 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.6884516740184029 \cdot 10^{-97}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right) + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 33.0 |
|---|
| Cost | 984 |
|---|
\[\begin{array}{l}
t_1 := z \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.047789951213995 \cdot 10^{-112}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -1.5885666356021187 \cdot 10^{-215}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq -3.472935259046197 \cdot 10^{-250}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.382762192175633 \cdot 10^{-270}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;y \leq 1.5622256122845442 \cdot 10^{-181}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4939117274220489 \cdot 10^{-111}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 21.8 |
|---|
| Cost | 976 |
|---|
\[\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;y \leq -1.6943556747065267 \cdot 10^{+52}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -5.039456862664458 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.887919779799315 \cdot 10^{-52}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 1.6884516740184029 \cdot 10^{-97}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 16.3 |
|---|
| 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 -1.6943556747065267 \cdot 10^{+52}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -9.211145413881336 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.0999557055183067 \cdot 10^{-67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.6884516740184029 \cdot 10^{-97}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 10.3 |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{if}\;y \leq -4.616864093037529 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4939117274220489 \cdot 10^{-111}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right) + x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 7.6 |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
t_1 := y \cdot 5 + x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;t \leq -1.6263857670574428 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.6034836119339164 \cdot 10^{-5}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 0.1 |
|---|
| Cost | 960 |
|---|
\[\left(x \cdot \left(\left(y + z\right) \cdot 2\right) + x \cdot t\right) + y \cdot 5
\]
| Alternative 10 |
|---|
| Error | 32.7 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.047789951213995 \cdot 10^{-112}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq 1.4939117274220489 \cdot 10^{-111}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 38.9 |
|---|
| Cost | 192 |
|---|
\[y \cdot 5
\]