\[ \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 | 11.7% |
|---|
| Cost | 7753 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+138} \lor \neg \left(t_1 \leq 4 \cdot 10^{+18}\right):\\
\;\;\;\;\left(z + \left(x + y\right)\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + z \cdot \left(1 - \log t\right)\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 14.98% |
|---|
| Cost | 7633 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
t_2 := z \cdot \left(1 - \log t\right)\\
t_3 := \left(z + \left(x + y\right)\right) + t_1\\
\mathbf{if}\;b \leq -3.5 \cdot 10^{+18}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \leq 60000000:\\
\;\;\;\;x + \left(y + t_2\right)\\
\mathbf{elif}\;b \leq 1.08 \cdot 10^{+80} \lor \neg \left(b \leq 5.2 \cdot 10^{+192}\right):\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1 + t_2\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 13.53% |
|---|
| Cost | 7378 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+200} \lor \neg \left(z \leq -3.15 \cdot 10^{+175} \lor \neg \left(z \leq -8.5 \cdot 10^{+133}\right) \land z \leq 2.2 \cdot 10^{+148}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + \left(x + y\right)\right) + \left(a + -0.5\right) \cdot b\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 13.52% |
|---|
| Cost | 7376 |
|---|
\[\begin{array}{l}
t_1 := \left(z + \left(x + y\right)\right) + \left(a + -0.5\right) \cdot b\\
t_2 := x + z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+201}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{+176}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{+130}:\\
\;\;\;\;x + \left(z - z \cdot \log t\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+148}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 9.9% |
|---|
| Cost | 7364 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{-37}:\\
\;\;\;\;\left(z + \left(x + y\right)\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 + \left(z + y\right)\right) - z \cdot \log t\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 0.15% |
|---|
| Cost | 7360 |
|---|
\[\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b
\]
| Alternative 7 |
|---|
| Error | 15.04% |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+130}:\\
\;\;\;\;x + t_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+52}:\\
\;\;\;\;\left(z + \left(x + y\right)\right) + \left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 16.62% |
|---|
| Cost | 6985 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+200} \lor \neg \left(z \leq 9.5 \cdot 10^{+259}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + \left(x + y\right)\right) + \left(a + -0.5\right) \cdot b\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 48.81% |
|---|
| Cost | 1232 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+47}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x + y \leq -5 \cdot 10^{-121}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;x + y \leq 10^{-217}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x + y \leq 1000000000000:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 41.01% |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+47}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x + y \leq 5 \cdot 10^{+69}:\\
\;\;\;\;\left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 37.48% |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{-17}:\\
\;\;\;\;x + -0.5 \cdot b\\
\mathbf{elif}\;x + y \leq 5 \cdot 10^{+69}:\\
\;\;\;\;\left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 35% |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{-17}:\\
\;\;\;\;x + -0.5 \cdot b\\
\mathbf{elif}\;x + y \leq 1000000000000:\\
\;\;\;\;\left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 34.88% |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{-17}:\\
\;\;\;\;x + -0.5 \cdot b\\
\mathbf{elif}\;x + y \leq 10^{-59}:\\
\;\;\;\;\left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 58.37% |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-71}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;x \leq -2.02 \cdot 10^{-252}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-300}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 29.99% |
|---|
| Cost | 708 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x + y \leq 10^{-59}:\\
\;\;\;\;x + \left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 24.93% |
|---|
| Cost | 708 |
|---|
\[\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
\mathbf{if}\;x + y \leq -1 \cdot 10^{-136}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 23.3% |
|---|
| Cost | 704 |
|---|
\[\left(z + \left(x + y\right)\right) + \left(a + -0.5\right) \cdot b
\]
| Alternative 18 |
|---|
| Error | 57.7% |
|---|
| Cost | 196 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.72 \cdot 10^{-7}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 19 |
|---|
| Error | 74.87% |
|---|
| Cost | 64 |
|---|
\[x
\]