| Alternative 1 | |
|---|---|
| Error | 35.6 |
| Cost | 1904 |
(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 (+ (+ x (* z (- 1.0 y))) (- a (fma a t (* b (- 2.0 (+ y t)))))))
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 (x + (z * (1.0 - y))) + (a - fma(a, t, (b * (2.0 - (y + t)))));
}
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 Float64(Float64(x + Float64(z * Float64(1.0 - y))) + Float64(a - fma(a, t, Float64(b * Float64(2.0 - Float64(y + t)))))) 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[(x + N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a - N[(a * t + N[(b * N[(2.0 - N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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
\left(x + z \cdot \left(1 - y\right)\right) + \left(a - \mathsf{fma}\left(a, t, b \cdot \left(2 - \left(y + t\right)\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
\] |
|---|---|
associate-+l- [=>]0.0 | \[ \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)}
\] |
sub-neg [=>]0.0 | \[ \color{blue}{\left(x - \left(y - 1\right) \cdot z\right) + \left(-\left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)}
\] |
neg-sub0 [=>]0.0 | \[ \left(x - \left(y - 1\right) \cdot z\right) + \color{blue}{\left(0 - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)\right)}
\] |
associate-+r- [=>]0.0 | \[ \color{blue}{\left(\left(x - \left(y - 1\right) \cdot z\right) + 0\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)}
\] |
+-rgt-identity [=>]0.0 | \[ \color{blue}{\left(x - \left(y - 1\right) \cdot z\right)} - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)
\] |
sub-neg [=>]0.0 | \[ \left(x - \color{blue}{\left(y + \left(-1\right)\right)} \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)
\] |
metadata-eval [=>]0.0 | \[ \left(x - \left(y + \color{blue}{-1}\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a - \left(\left(y + t\right) - 2\right) \cdot b\right)
\] |
sub-neg [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \color{blue}{\left(\left(t - 1\right) \cdot a + \left(-\left(\left(y + t\right) - 2\right) \cdot b\right)\right)}
\] |
neg-mul-1 [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a + \color{blue}{-1 \cdot \left(\left(\left(y + t\right) - 2\right) \cdot b\right)}\right)
\] |
metadata-eval [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a + \color{blue}{\left(-1\right)} \cdot \left(\left(\left(y + t\right) - 2\right) \cdot b\right)\right)
\] |
cancel-sign-sub-inv [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \color{blue}{\left(\left(t - 1\right) \cdot a - 1 \cdot \left(\left(\left(y + t\right) - 2\right) \cdot b\right)\right)}
\] |
sub-neg [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\color{blue}{\left(t + \left(-1\right)\right)} \cdot a - 1 \cdot \left(\left(\left(y + t\right) - 2\right) \cdot b\right)\right)
\] |
metadata-eval [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + \color{blue}{-1}\right) \cdot a - 1 \cdot \left(\left(\left(y + t\right) - 2\right) \cdot b\right)\right)
\] |
*-lft-identity [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + -1\right) \cdot a - \color{blue}{\left(\left(y + t\right) - 2\right) \cdot b}\right)
\] |
associate--l+ [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + -1\right) \cdot a - \color{blue}{\left(y + \left(t - 2\right)\right)} \cdot b\right)
\] |
Taylor expanded in a around 0 0.0
Simplified0.0
[Start]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t - 1\right) \cdot a + -1 \cdot \left(\left(\left(y + t\right) - 2\right) \cdot b\right)\right)
\] |
|---|---|
sub-neg [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\color{blue}{\left(t + \left(-1\right)\right)} \cdot a + -1 \cdot \left(\left(\left(y + t\right) - 2\right) \cdot b\right)\right)
\] |
metadata-eval [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + \color{blue}{-1}\right) \cdot a + -1 \cdot \left(\left(\left(y + t\right) - 2\right) \cdot b\right)\right)
\] |
associate-*r* [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + -1\right) \cdot a + \color{blue}{\left(-1 \cdot \left(\left(y + t\right) - 2\right)\right) \cdot b}\right)
\] |
sub-neg [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + -1\right) \cdot a + \left(-1 \cdot \color{blue}{\left(\left(y + t\right) + \left(-2\right)\right)}\right) \cdot b\right)
\] |
+-commutative [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + -1\right) \cdot a + \left(-1 \cdot \left(\color{blue}{\left(t + y\right)} + \left(-2\right)\right)\right) \cdot b\right)
\] |
metadata-eval [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + -1\right) \cdot a + \left(-1 \cdot \left(\left(t + y\right) + \color{blue}{-2}\right)\right) \cdot b\right)
\] |
associate-+r+ [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + -1\right) \cdot a + \left(-1 \cdot \color{blue}{\left(t + \left(y + -2\right)\right)}\right) \cdot b\right)
\] |
neg-mul-1 [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + -1\right) \cdot a + \color{blue}{\left(-\left(t + \left(y + -2\right)\right)\right)} \cdot b\right)
\] |
cancel-sign-sub-inv [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \color{blue}{\left(\left(t + -1\right) \cdot a - \left(t + \left(y + -2\right)\right) \cdot b\right)}
\] |
*-commutative [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\color{blue}{a \cdot \left(t + -1\right)} - \left(t + \left(y + -2\right)\right) \cdot b\right)
\] |
distribute-rgt-out [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\color{blue}{\left(t \cdot a + -1 \cdot a\right)} - \left(t + \left(y + -2\right)\right) \cdot b\right)
\] |
+-commutative [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\color{blue}{\left(-1 \cdot a + t \cdot a\right)} - \left(t + \left(y + -2\right)\right) \cdot b\right)
\] |
*-commutative [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(-1 \cdot a + \color{blue}{a \cdot t}\right) - \left(t + \left(y + -2\right)\right) \cdot b\right)
\] |
associate--l+ [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \color{blue}{\left(-1 \cdot a + \left(a \cdot t - \left(t + \left(y + -2\right)\right) \cdot b\right)\right)}
\] |
unsub-neg [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(-1 \cdot a + \color{blue}{\left(a \cdot t + \left(-\left(t + \left(y + -2\right)\right) \cdot b\right)\right)}\right)
\] |
distribute-rgt-neg-out [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(-1 \cdot a + \left(a \cdot t + \color{blue}{\left(t + \left(y + -2\right)\right) \cdot \left(-b\right)}\right)\right)
\] |
+-commutative [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(-1 \cdot a + \color{blue}{\left(\left(t + \left(y + -2\right)\right) \cdot \left(-b\right) + a \cdot t\right)}\right)
\] |
+-commutative [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \color{blue}{\left(\left(\left(t + \left(y + -2\right)\right) \cdot \left(-b\right) + a \cdot t\right) + -1 \cdot a\right)}
\] |
mul-1-neg [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(\left(t + \left(y + -2\right)\right) \cdot \left(-b\right) + a \cdot t\right) + \color{blue}{\left(-a\right)}\right)
\] |
unsub-neg [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \color{blue}{\left(\left(\left(t + \left(y + -2\right)\right) \cdot \left(-b\right) + a \cdot t\right) - a\right)}
\] |
+-commutative [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\color{blue}{\left(a \cdot t + \left(t + \left(y + -2\right)\right) \cdot \left(-b\right)\right)} - a\right)
\] |
fma-def [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\color{blue}{\mathsf{fma}\left(a, t, \left(t + \left(y + -2\right)\right) \cdot \left(-b\right)\right)} - a\right)
\] |
distribute-rgt-neg-out [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\mathsf{fma}\left(a, t, \color{blue}{-\left(t + \left(y + -2\right)\right) \cdot b}\right) - a\right)
\] |
*-commutative [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\mathsf{fma}\left(a, t, -\color{blue}{b \cdot \left(t + \left(y + -2\right)\right)}\right) - a\right)
\] |
distribute-rgt-neg-in [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\mathsf{fma}\left(a, t, \color{blue}{b \cdot \left(-\left(t + \left(y + -2\right)\right)\right)}\right) - a\right)
\] |
associate-+r+ [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\mathsf{fma}\left(a, t, b \cdot \left(-\color{blue}{\left(\left(t + y\right) + -2\right)}\right)\right) - a\right)
\] |
+-commutative [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\mathsf{fma}\left(a, t, b \cdot \left(-\left(\color{blue}{\left(y + t\right)} + -2\right)\right)\right) - a\right)
\] |
distribute-neg-in [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\mathsf{fma}\left(a, t, b \cdot \color{blue}{\left(\left(-\left(y + t\right)\right) + \left(--2\right)\right)}\right) - a\right)
\] |
metadata-eval [=>]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\mathsf{fma}\left(a, t, b \cdot \left(\left(-\left(y + t\right)\right) + \color{blue}{2}\right)\right) - a\right)
\] |
+-commutative [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\mathsf{fma}\left(a, t, b \cdot \color{blue}{\left(2 + \left(-\left(y + t\right)\right)\right)}\right) - a\right)
\] |
sub-neg [<=]0.0 | \[ \left(x - \left(y + -1\right) \cdot z\right) - \left(\mathsf{fma}\left(a, t, b \cdot \color{blue}{\left(2 - \left(y + t\right)\right)}\right) - a\right)
\] |
Final simplification0.0
| Alternative 1 | |
|---|---|
| Error | 35.6 |
| Cost | 1904 |
| Alternative 2 | |
|---|---|
| Error | 31.5 |
| Cost | 1768 |
| Alternative 3 | |
|---|---|
| Error | 33.9 |
| Cost | 1636 |
| Alternative 4 | |
|---|---|
| Error | 31.3 |
| Cost | 1636 |
| Alternative 5 | |
|---|---|
| Error | 24.6 |
| Cost | 1632 |
| Alternative 6 | |
|---|---|
| Error | 18.1 |
| Cost | 1500 |
| Alternative 7 | |
|---|---|
| Error | 2.0 |
| Cost | 1481 |
| Alternative 8 | |
|---|---|
| Error | 39.1 |
| Cost | 1376 |
| Alternative 9 | |
|---|---|
| Error | 39.6 |
| Cost | 1376 |
| Alternative 10 | |
|---|---|
| Error | 37.4 |
| Cost | 1376 |
| Alternative 11 | |
|---|---|
| Error | 37.2 |
| Cost | 1376 |
| Alternative 12 | |
|---|---|
| Error | 25.1 |
| Cost | 1372 |
| Alternative 13 | |
|---|---|
| Error | 25.0 |
| Cost | 1372 |
| Alternative 14 | |
|---|---|
| Error | 0.0 |
| Cost | 1344 |
| Alternative 15 | |
|---|---|
| Error | 15.1 |
| Cost | 1236 |
| Alternative 16 | |
|---|---|
| Error | 2.2 |
| Cost | 1225 |
| Alternative 17 | |
|---|---|
| Error | 36.8 |
| Cost | 1112 |
| Alternative 18 | |
|---|---|
| Error | 9.3 |
| Cost | 1100 |
| Alternative 19 | |
|---|---|
| Error | 7.2 |
| Cost | 1097 |
| Alternative 20 | |
|---|---|
| Error | 44.4 |
| Cost | 724 |
| Alternative 21 | |
|---|---|
| Error | 36.3 |
| Cost | 652 |
| Alternative 22 | |
|---|---|
| Error | 35.3 |
| Cost | 652 |
| Alternative 23 | |
|---|---|
| Error | 43.9 |
| Cost | 460 |
| Alternative 24 | |
|---|---|
| Error | 35.6 |
| Cost | 456 |
| Alternative 25 | |
|---|---|
| Error | 43.6 |
| Cost | 328 |
| Alternative 26 | |
|---|---|
| Error | 53.5 |
| Cost | 64 |
herbie shell --seed 2022364
(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)))