\[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\]
↓
\[\mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right)
\]
(FPCore (x y z)
:precision binary64
(+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
↓
(FPCore (x y z) :precision binary64 (fma (- y x) (fma z -6.0 4.0) x))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
↓
double code(double x, double y, double z) {
return fma((y - x), fma(z, -6.0, 4.0), x);
}
function code(x, y, z)
return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z)))
end
↓
function code(x, y, z)
return fma(Float64(y - x), fma(z, -6.0, 4.0), x)
end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(z * -6.0 + 4.0), $MachinePrecision] + x), $MachinePrecision]
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
↓
\mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right)
Alternatives
| Alternative 1 |
|---|
| Error | 0.3 |
|---|
| Cost | 7360 |
|---|
\[\mathsf{fma}\left(1 + -6 \cdot \left(0.6666666666666666 - z\right), x, \left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\right)
\]
| Alternative 2 |
|---|
| Error | 32.7 |
|---|
| Cost | 2169 |
|---|
\[\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -410000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-57}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-124}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-209}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-251}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-252}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-167}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{-155}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-61}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-30}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{+51} \lor \neg \left(z \leq 2.9 \cdot 10^{+92}\right) \land z \leq 3.15 \cdot 10^{+152}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 32.8 |
|---|
| Cost | 2168 |
|---|
\[\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -410000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-57}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.12 \cdot 10^{-123}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-205}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-251}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-251}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-171}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-155}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-61}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-31}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+53}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+119}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+152}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 32.8 |
|---|
| Cost | 2168 |
|---|
\[\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -410000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-51}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-124}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-208}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-251}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-251}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{-170}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.72 \cdot 10^{-155}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-61}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-35}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.62 \cdot 10^{+56}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+118}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+152}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 32.8 |
|---|
| Cost | 2168 |
|---|
\[\begin{array}{l}
t_0 := z \cdot \left(y \cdot -6\right)\\
\mathbf{if}\;z \leq -410000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.9 \cdot 10^{-44}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-124}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-207}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-251}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-251}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-180}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-155}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-61}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-35}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+47}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+118}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq 3.85 \cdot 10^{+152}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 21.5 |
|---|
| Cost | 1900 |
|---|
\[\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.1 \cdot 10^{-47}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-123}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-205}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-249}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-251}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-168}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.05 \cdot 10^{-155}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-61}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-35}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 32.4 |
|---|
| Cost | 1772 |
|---|
\[\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -410000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-45}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-122}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-207}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-250}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-252}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-174}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-155}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-61}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-29}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 20.9 |
|---|
| Cost | 1768 |
|---|
\[\begin{array}{l}
t_0 := x \cdot \left(-3 - z \cdot -6\right)\\
t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -490000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-57}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-123}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-209}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-250}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-252}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-169}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-155}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-61}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 17000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 20.9 |
|---|
| Cost | 1768 |
|---|
\[\begin{array}{l}
t_0 := x \cdot \left(-3 - z \cdot -6\right)\\
t_1 := z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{if}\;z \leq -1950000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-50}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-124}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-207}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-251}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-252}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-172}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-155}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-60}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 20500000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 0.3 |
|---|
| Cost | 1088 |
|---|
\[x \cdot \left(1 + -6 \cdot \left(0.6666666666666666 - z\right)\right) + 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)
\]
| Alternative 11 |
|---|
| Error | 17.4 |
|---|
| Cost | 978 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -9.6 \cdot 10^{-76} \lor \neg \left(x \leq 2.8 \cdot 10^{-127}\right) \land \left(x \leq 7 \cdot 10^{-92} \lor \neg \left(x \leq 4.3 \cdot 10^{-25}\right)\right):\\
\;\;\;\;x \cdot \left(-3 - z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 0.2 |
|---|
| Cost | 960 |
|---|
\[\left(x + \left(y - x\right) \cdot \left(z \cdot -6\right)\right) + \left(y - x\right) \cdot 4
\]
| Alternative 13 |
|---|
| Error | 0.3 |
|---|
| Cost | 832 |
|---|
\[x + \frac{\left(y - x\right) \cdot 6}{\frac{1}{0.6666666666666666 - z}}
\]
| Alternative 14 |
|---|
| Error | 1.7 |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -0.56 \lor \neg \left(z \leq 0.58\right):\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 0.4 |
|---|
| Cost | 704 |
|---|
\[x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right)
\]
| Alternative 16 |
|---|
| Error | 33.3 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-68}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-9}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 43.0 |
|---|
| Cost | 192 |
|---|
\[y \cdot 4
\]