| Alternative 1 | |
|---|---|
| Error | 0.0 |
| Cost | 7616 |
\[x - \mathsf{fma}\left(y + -1, z, a \cdot \left(t + -1\right) + b \cdot \left(\left(2 - t\right) - y\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 (- 2.0 t)) 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 - (2.0 - t)), 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(2.0 - t)), 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[(2.0 - t), $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(2 - t\right), b, \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\right)
Initial program 0.0
Simplified0.0
[Start]0.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 [=>]0.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 [=>]0.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 [=>]0.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+ [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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- [=>]0.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 [<=]0.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 [=>]0.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 [<=]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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- [=>]0.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 [<=]0.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 [=>]0.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 [<=]0.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 simplification0.0
| Alternative 1 | |
|---|---|
| Error | 0.0 |
| Cost | 7616 |
| Alternative 2 | |
|---|---|
| Error | 34.8 |
| Cost | 2428 |
| Alternative 3 | |
|---|---|
| Error | 41.1 |
| Cost | 2305 |
| Alternative 4 | |
|---|---|
| Error | 38.9 |
| Cost | 2169 |
| Alternative 5 | |
|---|---|
| Error | 39.6 |
| Cost | 2169 |
| Alternative 6 | |
|---|---|
| Error | 28.1 |
| Cost | 1900 |
| Alternative 7 | |
|---|---|
| Error | 28.8 |
| Cost | 1504 |
| Alternative 8 | |
|---|---|
| Error | 28.9 |
| Cost | 1372 |
| Alternative 9 | |
|---|---|
| Error | 7.7 |
| Cost | 1360 |
| Alternative 10 | |
|---|---|
| Error | 7.8 |
| Cost | 1360 |
| Alternative 11 | |
|---|---|
| Error | 0.0 |
| Cost | 1344 |
| Alternative 12 | |
|---|---|
| Error | 19.1 |
| Cost | 1236 |
| Alternative 13 | |
|---|---|
| Error | 15.1 |
| Cost | 1232 |
| Alternative 14 | |
|---|---|
| Error | 13.5 |
| Cost | 1232 |
| Alternative 15 | |
|---|---|
| Error | 13.2 |
| Cost | 1232 |
| Alternative 16 | |
|---|---|
| Error | 2.2 |
| Cost | 1225 |
| Alternative 17 | |
|---|---|
| Error | 34.3 |
| Cost | 1112 |
| Alternative 18 | |
|---|---|
| Error | 19.2 |
| Cost | 1104 |
| Alternative 19 | |
|---|---|
| Error | 46.3 |
| Cost | 984 |
| Alternative 20 | |
|---|---|
| Error | 35.1 |
| Cost | 984 |
| Alternative 21 | |
|---|---|
| Error | 25.0 |
| Cost | 976 |
| Alternative 22 | |
|---|---|
| Error | 28.3 |
| Cost | 848 |
| Alternative 23 | |
|---|---|
| Error | 45.6 |
| Cost | 724 |
| Alternative 24 | |
|---|---|
| Error | 45.7 |
| Cost | 724 |
| Alternative 25 | |
|---|---|
| Error | 34.4 |
| Cost | 720 |
| Alternative 26 | |
|---|---|
| Error | 27.6 |
| Cost | 585 |
| Alternative 27 | |
|---|---|
| Error | 36.7 |
| Cost | 456 |
| Alternative 28 | |
|---|---|
| Error | 44.1 |
| Cost | 328 |
| Alternative 29 | |
|---|---|
| Error | 53.7 |
| Cost | 64 |
herbie shell --seed 2023031
(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)))