| Alternative 1 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 13888 |
\[\mathsf{fma}\left(y + \left(t + -2\right), b, x - \mathsf{fma}\left(y + -1, z, a \cdot \left(t + -1\right)\right)\right)
\]
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
(FPCore (x y z t a b) :precision binary64 (fma (+ y (+ t -2.0)) b (fma a (- 1.0 t) (fma z (- 1.0 y) x))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
double code(double x, double y, double z, double t, double a, double b) {
return fma((y + (t + -2.0)), b, fma(a, (1.0 - t), fma(z, (1.0 - y), x)));
}
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function code(x, y, z, t, a, b) return fma(Float64(y + Float64(t + -2.0)), b, fma(a, Float64(1.0 - t), fma(z, Float64(1.0 - y), x))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_] := N[(N[(y + N[(t + -2.0), $MachinePrecision]), $MachinePrecision] * b + N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\right)
Initial program 100.0%
Simplified100.0%
[Start]100.0 | \[ \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\] |
|---|---|
+-commutative [=>]100.0 | \[ \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b + \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right)}
\] |
fma-def [=>]100.0 | \[ \color{blue}{\mathsf{fma}\left(\left(y + t\right) - 2, b, \left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right)}
\] |
sub-neg [=>]100.0 | \[ \mathsf{fma}\left(\color{blue}{\left(y + t\right) + \left(-2\right)}, b, \left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right)
\] |
associate-+l+ [=>]100.0 | \[ \mathsf{fma}\left(\color{blue}{y + \left(t + \left(-2\right)\right)}, b, \left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right)
\] |
metadata-eval [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + \color{blue}{-2}\right), b, \left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right)
\] |
cancel-sign-sub-inv [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) + \left(-\left(t - 1\right)\right) \cdot a}\right)
\] |
+-commutative [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \color{blue}{\left(-\left(t - 1\right)\right) \cdot a + \left(x - \left(y - 1\right) \cdot z\right)}\right)
\] |
*-commutative [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \color{blue}{a \cdot \left(-\left(t - 1\right)\right)} + \left(x - \left(y - 1\right) \cdot z\right)\right)
\] |
fma-def [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \color{blue}{\mathsf{fma}\left(a, -\left(t - 1\right), x - \left(y - 1\right) \cdot z\right)}\right)
\] |
neg-sub0 [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, \color{blue}{0 - \left(t - 1\right)}, x - \left(y - 1\right) \cdot z\right)\right)
\] |
associate--r- [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, \color{blue}{\left(0 - t\right) + 1}, x - \left(y - 1\right) \cdot z\right)\right)
\] |
neg-sub0 [<=]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, \color{blue}{\left(-t\right)} + 1, x - \left(y - 1\right) \cdot z\right)\right)
\] |
+-commutative [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, \color{blue}{1 + \left(-t\right)}, x - \left(y - 1\right) \cdot z\right)\right)
\] |
sub-neg [<=]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, \color{blue}{1 - t}, x - \left(y - 1\right) \cdot z\right)\right)
\] |
cancel-sign-sub-inv [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, 1 - t, \color{blue}{x + \left(-\left(y - 1\right)\right) \cdot z}\right)\right)
\] |
+-commutative [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, 1 - t, \color{blue}{\left(-\left(y - 1\right)\right) \cdot z + x}\right)\right)
\] |
*-commutative [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, 1 - t, \color{blue}{z \cdot \left(-\left(y - 1\right)\right)} + x\right)\right)
\] |
fma-def [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, 1 - t, \color{blue}{\mathsf{fma}\left(z, -\left(y - 1\right), x\right)}\right)\right)
\] |
neg-sub0 [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, \color{blue}{0 - \left(y - 1\right)}, x\right)\right)\right)
\] |
associate--r- [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, \color{blue}{\left(0 - y\right) + 1}, x\right)\right)\right)
\] |
neg-sub0 [<=]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, \color{blue}{\left(-y\right)} + 1, x\right)\right)\right)
\] |
+-commutative [=>]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, \color{blue}{1 + \left(-y\right)}, x\right)\right)\right)
\] |
sub-neg [<=]100.0 | \[ \mathsf{fma}\left(y + \left(t + -2\right), b, \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, \color{blue}{1 - y}, x\right)\right)\right)
\] |
Final simplification100.0%
| Alternative 1 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 13888 |
| Alternative 2 | |
|---|---|
| Accuracy | 45.7% |
| Cost | 1905 |
| Alternative 3 | |
|---|---|
| Accuracy | 88.0% |
| Cost | 1753 |
| Alternative 4 | |
|---|---|
| Accuracy | 88.0% |
| Cost | 1753 |
| Alternative 5 | |
|---|---|
| Accuracy | 44.3% |
| Cost | 1640 |
| Alternative 6 | |
|---|---|
| Accuracy | 44.5% |
| Cost | 1508 |
| Alternative 7 | |
|---|---|
| Accuracy | 45.6% |
| Cost | 1504 |
| Alternative 8 | |
|---|---|
| Accuracy | 39.7% |
| Cost | 1376 |
| Alternative 9 | |
|---|---|
| Accuracy | 40.8% |
| Cost | 1376 |
| Alternative 10 | |
|---|---|
| Accuracy | 81.0% |
| Cost | 1362 |
| Alternative 11 | |
|---|---|
| Accuracy | 86.4% |
| Cost | 1361 |
| Alternative 12 | |
|---|---|
| Accuracy | 81.9% |
| Cost | 1360 |
| Alternative 13 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 1344 |
| Alternative 14 | |
|---|---|
| Accuracy | 25.4% |
| Cost | 1312 |
| Alternative 15 | |
|---|---|
| Accuracy | 33.2% |
| Cost | 1180 |
| Alternative 16 | |
|---|---|
| Accuracy | 53.6% |
| Cost | 1108 |
| Alternative 17 | |
|---|---|
| Accuracy | 61.5% |
| Cost | 1104 |
| Alternative 18 | |
|---|---|
| Accuracy | 57.0% |
| Cost | 976 |
| Alternative 19 | |
|---|---|
| Accuracy | 76.3% |
| Cost | 841 |
| Alternative 20 | |
|---|---|
| Accuracy | 30.6% |
| Cost | 592 |
| Alternative 21 | |
|---|---|
| Accuracy | 30.1% |
| Cost | 592 |
| Alternative 22 | |
|---|---|
| Accuracy | 47.8% |
| Cost | 585 |
| Alternative 23 | |
|---|---|
| Accuracy | 31.0% |
| Cost | 328 |
| Alternative 24 | |
|---|---|
| Accuracy | 15.9% |
| Cost | 64 |
herbie shell --seed 2023131
(FPCore (x y z t a b)
:name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
:precision binary64
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))