\[\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\]
↓
\[\mathsf{fma}\left(b, a + -0.5, \mathsf{fma}\left(z, 1 - \log t, x + 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
(fma b (+ a -0.5) (fma z (- 1.0 (log t)) (+ x 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 fma(b, (a + -0.5), fma(z, (1.0 - log(t)), (x + 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 fma(b, Float64(a + -0.5), fma(z, Float64(1.0 - log(t)), Float64(x + 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[(b * N[(a + -0.5), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $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(b, a + -0.5, \mathsf{fma}\left(z, 1 - \log t, x + y\right)\right)
Alternatives
| Alternative 1 |
|---|
| Error | 0.7 |
|---|
| Cost | 7752 |
|---|
\[\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -2000:\\
\;\;\;\;\left(\left(x + y\right) + z \cdot \left(1 - \log t\right)\right) + a \cdot b\\
\mathbf{elif}\;a - 0.5 \leq -0.5:\\
\;\;\;\;\left(-0.5 \cdot b + \left(y + \left(z + x\right)\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x + y\right) + z\right) - t_1\right) + a \cdot b\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 4.8 |
|---|
| Cost | 7496 |
|---|
\[\begin{array}{l}
t_1 := \left(\left(x + y\right) + z \cdot \left(1 - \log t\right)\right) + a \cdot b\\
\mathbf{if}\;z \leq -1.22 \cdot 10^{+119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-24}:\\
\;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.1 |
|---|
| Cost | 7360 |
|---|
\[\left(\left(x + y\right) + z \cdot \left(1 - \log t\right)\right) + \left(a - 0.5\right) \cdot b
\]
| Alternative 4 |
|---|
| Error | 7.2 |
|---|
| Cost | 7240 |
|---|
\[\begin{array}{l}
t_1 := \left(1 - \log t\right) \cdot z + \left(y + x\right)\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.0115:\\
\;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 9.0 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
t_1 := \left(1 - \log t\right) \cdot z + x\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{+120}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+114}:\\
\;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 9.2 |
|---|
| Cost | 7112 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+121}:\\
\;\;\;\;\left(y + z\right) - z \cdot \log t\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+109}:\\
\;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \log t\right) \cdot z + x\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 11.3 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
t_1 := \left(1 - \log t\right) \cdot z\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+121}:\\
\;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 11.2 |
|---|
| Cost | 6984 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+120}:\\
\;\;\;\;\left(1 - \log t\right) \cdot z\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+123}:\\
\;\;\;\;\left(y + x\right) + \left(a - 0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;z - z \cdot \log t\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 40.9 |
|---|
| Cost | 1120 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+140}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{+64}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{+24}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-305}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-227}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-118}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{-40}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+22}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 38.2 |
|---|
| Cost | 1116 |
|---|
\[\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -5.7 \cdot 10^{-225}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-300}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-258}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+33}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+43}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 31.1 |
|---|
| Cost | 980 |
|---|
\[\begin{array}{l}
t_1 := -0.5 \cdot b + y\\
t_2 := -0.5 \cdot b + x\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+25}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.32 \cdot 10^{-129}:\\
\;\;\;\;y + a \cdot b\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-225}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.6 \cdot 10^{-303}:\\
\;\;\;\;\left(a - 0.5\right) \cdot b\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 30.9 |
|---|
| Cost | 980 |
|---|
\[\begin{array}{l}
t_1 := -0.5 \cdot b + y\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+25}:\\
\;\;\;\;-0.5 \cdot b + x\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-131}:\\
\;\;\;\;y + a \cdot b\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-224}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-303}:\\
\;\;\;\;\left(a - 0.5\right) \cdot b\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 33.7 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_1 := y + a \cdot b\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{-182}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-75}:\\
\;\;\;\;\left(a - 0.5\right) \cdot b\\
\mathbf{elif}\;x \leq 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 31.3 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_1 := y + a \cdot b\\
t_2 := -0.5 \cdot b + x\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+25}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-181}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.18 \cdot 10^{-79}:\\
\;\;\;\;\left(a - 0.5\right) \cdot b\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 23.2 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{+145}:\\
\;\;\;\;-0.5 \cdot b + y\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+65}:\\
\;\;\;\;x + \left(a - 0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 21.6 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
t_2 := x + t_1\\
\mathbf{if}\;x \leq -2 \cdot 10^{+26}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+34}:\\
\;\;\;\;y + t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 20.7 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;x \leq -8 \cdot 10^{+25}:\\
\;\;\;\;x + t_1\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+44}:\\
\;\;\;\;y + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + x\right) + a \cdot b\\
\end{array}
\]
| Alternative 18 |
|---|
| Error | 15.8 |
|---|
| Cost | 576 |
|---|
\[\left(y + x\right) + \left(a - 0.5\right) \cdot b
\]
| Alternative 19 |
|---|
| Error | 39.0 |
|---|
| Cost | 328 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+36}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 20 |
|---|
| Error | 47.8 |
|---|
| Cost | 64 |
|---|
\[x
\]