\[ \begin{array}{c}[x, y] = \mathsf{sort}([x, y])\\ \end{array} \]
\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\]
↓
\[x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)
\]
(FPCore (x y z t a b)
:precision binary64
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
↓
(FPCore (x y z t a b)
:precision binary64
(+ x (fma z (- 1.0 (log t)) (fma (+ a -0.5) b y))))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
↓
double code(double x, double y, double z, double t, double a, double b) {
return x + fma(z, (1.0 - log(t)), fma((a + -0.5), b, y));
}
function code(x, y, z, t, a, b)
return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b))
end
↓
function code(x, y, z, t, a, b)
return Float64(x + fma(z, Float64(1.0 - log(t)), fma(Float64(a + -0.5), b, y)))
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
↓
x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)
Alternatives
| Alternative 1 |
|---|
| Error | 33.67% |
|---|
| Cost | 7904 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
t_2 := y + t_1\\
t_3 := x + z \cdot \left(1 - \log t\right)\\
t_4 := x + t_1\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+135}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-211}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-295}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-286}:\\
\;\;\;\;x + -0.5 \cdot b\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-252}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-172}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{+128}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 33.77% |
|---|
| Cost | 7904 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
t_2 := y + t_1\\
t_3 := x + t_1\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+132}:\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{elif}\;z \leq -1.56 \cdot 10^{-37}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-214}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-295}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 5.7 \cdot 10^{-285}:\\
\;\;\;\;x + -0.5 \cdot b\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{-255}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-174}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+125}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - z \cdot \log t\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 25.92% |
|---|
| Cost | 7889 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
\mathbf{if}\;x + y \leq 5 \cdot 10^{-81}:\\
\;\;\;\;x + t_1\\
\mathbf{elif}\;x + y \leq 2 \cdot 10^{-17} \lor \neg \left(x + y \leq 10^{+155}\right) \land x + y \leq 5 \cdot 10^{+202}:\\
\;\;\;\;y + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 17.59% |
|---|
| Cost | 7889 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
t_2 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;x + y \leq -2 \cdot 10^{+85}:\\
\;\;\;\;\left(x + y\right) + t_2\\
\mathbf{elif}\;x + y \leq 2 \cdot 10^{+77}:\\
\;\;\;\;t_1 + t_2\\
\mathbf{elif}\;x + y \leq 10^{+155} \lor \neg \left(x + y \leq 5 \cdot 10^{+202}\right):\\
\;\;\;\;y + t_1\\
\mathbf{else}:\\
\;\;\;\;y + t_2\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 37.36% |
|---|
| Cost | 7776 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
t_2 := x + t_1\\
t_3 := z \cdot \left(1 - \log t\right)\\
t_4 := y + t_1\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+158}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-211}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-298}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-282}:\\
\;\;\;\;x + -0.5 \cdot b\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-251}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-169}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+43}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{+162}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 37.4% |
|---|
| Cost | 7776 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
t_2 := x + t_1\\
t_3 := y + t_1\\
\mathbf{if}\;z \leq -9 \cdot 10^{+158}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{elif}\;z \leq -6.1 \cdot 10^{-220}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-296}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-286}:\\
\;\;\;\;x + -0.5 \cdot b\\
\mathbf{elif}\;z \leq 1.58 \cdot 10^{-254}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-176}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+45}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+159}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;z - z \cdot \log t\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 15.41% |
|---|
| Cost | 7753 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+111} \lor \neg \left(t_1 \leq 5 \cdot 10^{+118}\right):\\
\;\;\;\;y + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 9.04% |
|---|
| Cost | 7629 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
\mathbf{if}\;x + y \leq 2 \cdot 10^{+77}:\\
\;\;\;\;\left(t_1 + \left(x + z\right)\right) - z \cdot \log t\\
\mathbf{elif}\;x + y \leq 10^{+155} \lor \neg \left(x + y \leq 5 \cdot 10^{+202}\right):\\
\;\;\;\;y + t_1\\
\mathbf{else}:\\
\;\;\;\;y + z \cdot \left(1 - \log t\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 0.15% |
|---|
| Cost | 7360 |
|---|
\[\left(a + -0.5\right) \cdot b + \left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right)
\]
| Alternative 10 |
|---|
| Error | 0.15% |
|---|
| Cost | 7360 |
|---|
\[\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + \left(a + -0.5\right) \cdot b
\]
| Alternative 11 |
|---|
| Error | 39.83% |
|---|
| Cost | 1097 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+111} \lor \neg \left(t_1 \leq 5 \cdot 10^{+118}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 49.9% |
|---|
| Cost | 984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{+127}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;b \leq -9 \cdot 10^{-13}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;b \leq -9.5 \cdot 10^{-77}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{+23}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+101}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;b \leq 5 \cdot 10^{+149}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot b\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 41.32% |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x + y \leq -2 \cdot 10^{+58}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{elif}\;x + y \leq 10^{+155}:\\
\;\;\;\;\left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 59.08% |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+58}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{-139}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-300}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 6.3 \cdot 10^{-283}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 25.58% |
|---|
| Cost | 708 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
\mathbf{if}\;x + y \leq -5 \cdot 10^{-178}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 59.64% |
|---|
| Cost | 588 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{+58}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -215000000000:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{-245}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 35.47% |
|---|
| Cost | 580 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 7.6 \cdot 10^{+154}:\\
\;\;\;\;x + \left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\]
| Alternative 18 |
|---|
| Error | 59.3% |
|---|
| Cost | 196 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 1.85 \cdot 10^{+87}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 19 |
|---|
| Error | 75.83% |
|---|
| Cost | 64 |
|---|
\[x
\]