\[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 | 32.3 |
|---|
| Cost | 1640 |
|---|
\[\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -300:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-78}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-233}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.82 \cdot 10^{-270}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-299}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-104}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-25}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;0.6666666666666666 \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+160}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 32.3 |
|---|
| Cost | 1640 |
|---|
\[\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -300:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-78}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-231}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-270}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-298}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-103}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-25}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;0.6666666666666666 \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+160}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 32.3 |
|---|
| Cost | 1640 |
|---|
\[\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -300:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-78}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-233}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.65 \cdot 10^{-270}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-298}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-105}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-25}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;0.6666666666666666 \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+160}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 32.3 |
|---|
| Cost | 1640 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -300:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-77}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-232}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-270}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -7.1 \cdot 10^{-299}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-105}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-24}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;0.6666666666666666 \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;z \leq 1.36 \cdot 10^{+162}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 32.4 |
|---|
| Cost | 1640 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -300:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-77}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-231}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.75 \cdot 10^{-270}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-298}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-104}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{-24}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;0.6666666666666666 \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;z \leq 2.32 \cdot 10^{+160}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 21.2 |
|---|
| Cost | 1636 |
|---|
\[\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-77}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-232}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-270}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -7.1 \cdot 10^{-299}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-104}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-25}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;0.6666666666666666 \cdot \left(y \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 32.9 |
|---|
| Cost | 1508 |
|---|
\[\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-77}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-232}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-270}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -4.55 \cdot 10^{-299}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-106}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-24}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 32.9 |
|---|
| Cost | 1508 |
|---|
\[\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-78}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-233}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-270}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-299}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-107}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-24}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;0.6666666666666666 \cdot \left(y \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 20.7 |
|---|
| Cost | 1504 |
|---|
\[\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 -5.4 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-77}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-233}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-270}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-298}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-105}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1050:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 18.4 |
|---|
| Cost | 1243 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+55} \lor \neg \left(x \leq -6.8 \cdot 10^{+31}\right) \land \left(x \leq -5.6 \cdot 10^{-49} \lor \neg \left(x \leq 2.8 \cdot 10^{-113}\right) \land \left(x \leq 1.15 \cdot 10^{+105} \lor \neg \left(x \leq 6 \cdot 10^{+137}\right)\right)\right):\\
\;\;\;\;x \cdot \left(-3 - z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 - \frac{z}{0.16666666666666666}\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 18.3 |
|---|
| Cost | 1242 |
|---|
\[\begin{array}{l}
t_0 := x \cdot \left(-3 - z \cdot -6\right)\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{+55}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{+32}:\\
\;\;\;\;\left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-48} \lor \neg \left(x \leq 4.2 \cdot 10^{-113}\right) \land \left(x \leq 6 \cdot 10^{+104} \lor \neg \left(x \leq 6 \cdot 10^{+137}\right)\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 - \frac{z}{0.16666666666666666}\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.2 |
|---|
| Cost | 960 |
|---|
\[y \cdot \left(4 + z \cdot -6\right) - x \cdot \left(3 + z \cdot -6\right)
\]
| Alternative 14 |
|---|
| Error | 34.6 |
|---|
| Cost | 721 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-49}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-113} \lor \neg \left(x \leq 10^{+105}\right) \land x \leq 6 \cdot 10^{+137}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 1.8 |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -0.55 \lor \neg \left(z \leq 0.5\right):\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 0.4 |
|---|
| Cost | 704 |
|---|
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\]
| Alternative 17 |
|---|
| Error | 0.2 |
|---|
| Cost | 704 |
|---|
\[x + \left(y - x\right) \cdot \left(4 + z \cdot -6\right)
\]
| Alternative 18 |
|---|
| Error | 43.2 |
|---|
| Cost | 192 |
|---|
\[y \cdot 4
\]