\[ \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 | 7.5 |
|---|
| Cost | 7753 |
|---|
\[\begin{array}{l}
t_1 := b \cdot \left(a + -0.5\right)\\
\mathbf{if}\;t_1 \leq -20000000000 \lor \neg \left(t_1 \leq 2 \cdot 10^{+55}\right):\\
\;\;\;\;\left(x + y\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.1 |
|---|
| Cost | 7360 |
|---|
\[\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + b \cdot \left(a + -0.5\right)
\]
| Alternative 3 |
|---|
| Error | 8.7 |
|---|
| Cost | 7113 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+197} \lor \neg \left(z \leq 2.05 \cdot 10^{+151}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a + -0.5\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 8.6 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+197}:\\
\;\;\;\;y + t_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+151}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + t_1\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 10.1 |
|---|
| Cost | 6985 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+197} \lor \neg \left(z \leq 2.6 \cdot 10^{+223}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a + -0.5\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 26.4 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+118}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;x + y \leq 10^{+116}:\\
\;\;\;\;b \cdot \left(a + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 24.8 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{-7}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{elif}\;x + y \leq 10^{+116}:\\
\;\;\;\;b \cdot \left(a + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 23.6 |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{-7}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{elif}\;x + y \leq 4 \cdot 10^{-120}:\\
\;\;\;\;b \cdot \left(a + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 37.8 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 6.8 \cdot 10^{-239}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-199}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-142}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+27}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 30.3 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{+130}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;b \leq 1.65 \cdot 10^{+85}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{+114}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{+168}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot b\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 20.2 |
|---|
| Cost | 708 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x + y \leq 4 \cdot 10^{-120}:\\
\;\;\;\;x + b \cdot \left(a + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 16.1 |
|---|
| Cost | 708 |
|---|
\[\begin{array}{l}
t_1 := b \cdot \left(a + -0.5\right)\\
\mathbf{if}\;x + y \leq -5 \cdot 10^{-123}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 15.6 |
|---|
| Cost | 576 |
|---|
\[\left(x + y\right) + b \cdot \left(a + -0.5\right)
\]
| Alternative 14 |
|---|
| Error | 37.4 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{-8}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.62 \cdot 10^{-111}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 37.7 |
|---|
| Cost | 196 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 2.7 \cdot 10^{-30}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 48.6 |
|---|
| Cost | 64 |
|---|
\[x
\]