\[ \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
\]
↓
\[\mathsf{fma}\left(z, 1 - \log t, y\right) + \mathsf{fma}\left(a + -0.5, b, x\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
(+ (fma z (- 1.0 (log t)) y) (fma (+ a -0.5) b x)))
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 fma(z, (1.0 - log(t)), y) + fma((a + -0.5), b, x);
}
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(fma(z, Float64(1.0 - log(t)), y) + fma(Float64(a + -0.5), b, x))
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[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
↓
\mathsf{fma}\left(z, 1 - \log t, y\right) + \mathsf{fma}\left(a + -0.5, b, x\right)
Alternatives
| Alternative 1 |
|---|
| Error | 7.7 |
|---|
| Cost | 8528 |
|---|
\[\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
t_2 := b \cdot \left(a + -0.5\right)\\
t_3 := t_2 + \left(y + x\right)\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+177}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq -1 \cdot 10^{+145}:\\
\;\;\;\;t_2 + t_1\\
\mathbf{elif}\;t_2 \leq -1 \cdot 10^{+63}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 10^{-6}:\\
\;\;\;\;\left(y + x\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 7.7 |
|---|
| Cost | 8528 |
|---|
\[\begin{array}{l}
t_1 := b \cdot \left(a + -0.5\right)\\
t_2 := t_1 + \left(y + x\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+177}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+145}:\\
\;\;\;\;\left(z + t_1\right) - z \cdot \log t\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+63}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 10^{-6}:\\
\;\;\;\;\left(y + x\right) + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 5.1 |
|---|
| Cost | 7628 |
|---|
\[\begin{array}{l}
t_1 := b \cdot \left(a + -0.5\right)\\
t_2 := \left(t_1 + \left(z + y\right)\right) - z \cdot \log t\\
\mathbf{if}\;y \leq 3.288464934908744 \cdot 10^{-73}:\\
\;\;\;\;\left(x + t_1\right) + z \cdot \left(1 - \log t\right)\\
\mathbf{elif}\;y \leq 4.1110262582815665 \cdot 10^{+138}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.4140216648230934 \cdot 10^{+207}:\\
\;\;\;\;t_1 + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.1 |
|---|
| Cost | 7488 |
|---|
\[\left(\left(z + \left(y + x\right)\right) - z \cdot \log t\right) + \left(a \cdot b + -0.5 \cdot b\right)
\]
| Alternative 5 |
|---|
| Error | 6.3 |
|---|
| Cost | 7364 |
|---|
\[\begin{array}{l}
t_1 := b \cdot \left(a + -0.5\right)\\
\mathbf{if}\;y \leq 4.1110262582815665 \cdot 10^{+138}:\\
\;\;\;\;\left(x + t_1\right) + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(y + x\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 0.1 |
|---|
| Cost | 7360 |
|---|
\[\left(\left(z + \left(y + x\right)\right) - z \cdot \log t\right) + b \cdot \left(a + -0.5\right)
\]
| Alternative 7 |
|---|
| Error | 6.0 |
|---|
| Cost | 7240 |
|---|
\[\begin{array}{l}
t_1 := \left(y + \left(z + x\right)\right) - z \cdot \log t\\
\mathbf{if}\;z \leq -2.0701900839372296 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.736851919285667 \cdot 10^{+67}:\\
\;\;\;\;b \cdot \left(a + -0.5\right) + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 6.0 |
|---|
| Cost | 7240 |
|---|
\[\begin{array}{l}
t_1 := \left(y + x\right) + z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -2.0701900839372296 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.736851919285667 \cdot 10^{+67}:\\
\;\;\;\;b \cdot \left(a + -0.5\right) + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 9.4 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_1 := y + z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -2.0701900839372296 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.736851919285667 \cdot 10^{+67}:\\
\;\;\;\;b \cdot \left(a + -0.5\right) + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 9.3 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -2.0701900839372296 \cdot 10^{+83}:\\
\;\;\;\;x + t_1\\
\mathbf{elif}\;z \leq 9.736851919285667 \cdot 10^{+67}:\\
\;\;\;\;b \cdot \left(a + -0.5\right) + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 10.4 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
t_1 := z - z \cdot \log t\\
\mathbf{if}\;z \leq -1.0538749300575403 \cdot 10^{+141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.811977119018121 \cdot 10^{+161}:\\
\;\;\;\;b \cdot \left(a + -0.5\right) + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 10.4 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.0538749300575403 \cdot 10^{+141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.811977119018121 \cdot 10^{+161}:\\
\;\;\;\;b \cdot \left(a + -0.5\right) + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 21.9 |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
t_1 := x + b \cdot \left(a + -0.5\right)\\
\mathbf{if}\;a + -0.5 \leq -4 \cdot 10^{+89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a + -0.5 \leq 3.5 \cdot 10^{+22}:\\
\;\;\;\;-0.5 \cdot b + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 38.1 |
|---|
| Cost | 852 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.66129577975365 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -9.953865208136259 \cdot 10^{-46}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;x \leq -1.1879676747619952 \cdot 10^{-104}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq -1.3055607845117415 \cdot 10^{-129}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;x \leq -2.599009019844032 \cdot 10^{-284}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 39.1 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_1 := z + -0.5 \cdot b\\
\mathbf{if}\;y \leq -2.862072819058999 \cdot 10^{-96}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -3.569320988680884 \cdot 10^{-225}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.305884094581866 \cdot 10^{-108}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.952330897824881 \cdot 10^{+117}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 33.2 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_1 := b \cdot \left(a + -0.5\right)\\
\mathbf{if}\;y \leq -1.1058912296354706 \cdot 10^{-72}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.5079165858325954 \cdot 10^{-288}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.484375110622336 \cdot 10^{-150}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9.867635379723362 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 19.9 |
|---|
| Cost | 844 |
|---|
\[\begin{array}{l}
t_1 := b \cdot \left(a + -0.5\right)\\
t_2 := y + t_1\\
\mathbf{if}\;y \leq 3.288464934908744 \cdot 10^{-73}:\\
\;\;\;\;x + t_1\\
\mathbf{elif}\;y \leq 3.952330897824881 \cdot 10^{+117}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.087004633761351 \cdot 10^{+168}:\\
\;\;\;\;-0.5 \cdot b + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 18 |
|---|
| Error | 38.3 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.7539542040282362 \cdot 10^{-146}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -3.569320988680884 \cdot 10^{-225}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;y \leq 3.6278078239214425 \cdot 10^{-107}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.4348466422266695 \cdot 10^{+88}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 19 |
|---|
| Error | 21.4 |
|---|
| Cost | 580 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 2.121904633360857 \cdot 10^{+121}:\\
\;\;\;\;x + b \cdot \left(a + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\]
| Alternative 20 |
|---|
| Error | 15.6 |
|---|
| Cost | 576 |
|---|
\[b \cdot \left(a + -0.5\right) + \left(y + x\right)
\]
| Alternative 21 |
|---|
| Error | 30.5 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.3598259744916037 \cdot 10^{+78}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\]
| Alternative 22 |
|---|
| Error | 37.4 |
|---|
| Cost | 196 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.1897615255818365 \cdot 10^{+20}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 23 |
|---|
| Error | 48.2 |
|---|
| Cost | 64 |
|---|
\[x
\]