| Alternative 1 | |
|---|---|
| Error | 37.5 |
| Cost | 2036 |
(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 (+ a (+ (* b -2.0) (+ (+ (+ z x) (* (- b z) y)) (* t (- b a))))))
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 a + ((b * -2.0) + (((z + x) + ((b - z) * y)) + (t * (b - a))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a + ((b * (-2.0d0)) + (((z + x) + ((b - z) * y)) + (t * (b - a))))
end function
public static 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);
}
public static double code(double x, double y, double z, double t, double a, double b) {
return a + ((b * -2.0) + (((z + x) + ((b - z) * y)) + (t * (b - a))));
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
def code(x, y, z, t, a, b): return a + ((b * -2.0) + (((z + x) + ((b - z) * y)) + (t * (b - a))))
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(a + Float64(Float64(b * -2.0) + Float64(Float64(Float64(z + x) + Float64(Float64(b - z) * y)) + Float64(t * Float64(b - a))))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
function tmp = code(x, y, z, t, a, b) tmp = a + ((b * -2.0) + (((z + x) + ((b - z) * y)) + (t * (b - a)))); 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[(a + N[(N[(b * -2.0), $MachinePrecision] + N[(N[(N[(z + x), $MachinePrecision] + N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + N[(t * N[(b - a), $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
a + \left(b \cdot -2 + \left(\left(\left(z + x\right) + \left(b - z\right) \cdot y\right) + t \cdot \left(b - a\right)\right)\right)
Results
Initial program 0.0
Taylor expanded in y around 0 0.0
Simplified0.0
[Start]0.0 | \[ \left(\left(t - 2\right) \cdot b + \left(\left(b - z\right) \cdot y + x\right)\right) - \left(-1 \cdot z + \left(t - 1\right) \cdot a\right)
\] |
|---|---|
rational_best.json-simplify-2 [=>]0.0 | \[ \left(\color{blue}{b \cdot \left(t - 2\right)} + \left(\left(b - z\right) \cdot y + x\right)\right) - \left(-1 \cdot z + \left(t - 1\right) \cdot a\right)
\] |
rational_best.json-simplify-1 [=>]0.0 | \[ \left(b \cdot \left(t - 2\right) + \color{blue}{\left(x + \left(b - z\right) \cdot y\right)}\right) - \left(-1 \cdot z + \left(t - 1\right) \cdot a\right)
\] |
rational_best.json-simplify-2 [=>]0.0 | \[ \left(b \cdot \left(t - 2\right) + \left(x + \color{blue}{y \cdot \left(b - z\right)}\right)\right) - \left(-1 \cdot z + \left(t - 1\right) \cdot a\right)
\] |
rational_best.json-simplify-2 [=>]0.0 | \[ \left(b \cdot \left(t - 2\right) + \left(x + y \cdot \left(b - z\right)\right)\right) - \left(\color{blue}{z \cdot -1} + \left(t - 1\right) \cdot a\right)
\] |
rational_best.json-simplify-12 [=>]0.0 | \[ \left(b \cdot \left(t - 2\right) + \left(x + y \cdot \left(b - z\right)\right)\right) - \left(\color{blue}{\left(-z\right)} + \left(t - 1\right) \cdot a\right)
\] |
rational_best.json-simplify-2 [=>]0.0 | \[ \left(b \cdot \left(t - 2\right) + \left(x + y \cdot \left(b - z\right)\right)\right) - \left(\left(-z\right) + \color{blue}{a \cdot \left(t - 1\right)}\right)
\] |
rational_best.json-simplify-18 [<=]0.0 | \[ \left(b \cdot \left(t - 2\right) + \left(x + y \cdot \left(b - z\right)\right)\right) - \left(\left(-z\right) + a \cdot \color{blue}{\left(t + -1\right)}\right)
\] |
Taylor expanded in t around 0 0.0
Simplified0.0
[Start]0.0 | \[ \left(t \cdot \left(b - a\right) + \left(-2 \cdot b + \left(z + \left(\left(b - z\right) \cdot y + x\right)\right)\right)\right) - -1 \cdot a
\] |
|---|---|
rational_best.json-simplify-2 [=>]0.0 | \[ \left(t \cdot \left(b - a\right) + \left(-2 \cdot b + \left(z + \left(\left(b - z\right) \cdot y + x\right)\right)\right)\right) - \color{blue}{a \cdot -1}
\] |
rational_best.json-simplify-12 [=>]0.0 | \[ \left(t \cdot \left(b - a\right) + \left(-2 \cdot b + \left(z + \left(\left(b - z\right) \cdot y + x\right)\right)\right)\right) - \color{blue}{\left(-a\right)}
\] |
rational_best.json-simplify-11 [=>]0.0 | \[ \left(t \cdot \left(b - a\right) + \left(-2 \cdot b + \left(z + \left(\left(b - z\right) \cdot y + x\right)\right)\right)\right) - \color{blue}{\left(0 - a\right)}
\] |
rational_best.json-simplify-46 [=>]0.0 | \[ \color{blue}{a + \left(\left(t \cdot \left(b - a\right) + \left(-2 \cdot b + \left(z + \left(\left(b - z\right) \cdot y + x\right)\right)\right)\right) - 0\right)}
\] |
rational_best.json-simplify-6 [=>]0.0 | \[ a + \color{blue}{\left(t \cdot \left(b - a\right) + \left(-2 \cdot b + \left(z + \left(\left(b - z\right) \cdot y + x\right)\right)\right)\right)}
\] |
rational_best.json-simplify-1 [=>]0.0 | \[ a + \left(t \cdot \left(b - a\right) + \color{blue}{\left(\left(z + \left(\left(b - z\right) \cdot y + x\right)\right) + -2 \cdot b\right)}\right)
\] |
rational_best.json-simplify-43 [=>]0.0 | \[ a + \color{blue}{\left(-2 \cdot b + \left(\left(z + \left(\left(b - z\right) \cdot y + x\right)\right) + t \cdot \left(b - a\right)\right)\right)}
\] |
rational_best.json-simplify-2 [=>]0.0 | \[ a + \left(\color{blue}{b \cdot -2} + \left(\left(z + \left(\left(b - z\right) \cdot y + x\right)\right) + t \cdot \left(b - a\right)\right)\right)
\] |
rational_best.json-simplify-1 [=>]0.0 | \[ a + \left(b \cdot -2 + \left(\left(z + \color{blue}{\left(x + \left(b - z\right) \cdot y\right)}\right) + t \cdot \left(b - a\right)\right)\right)
\] |
rational_best.json-simplify-2 [<=]0.0 | \[ a + \left(b \cdot -2 + \left(\left(z + \left(x + \color{blue}{y \cdot \left(b - z\right)}\right)\right) + t \cdot \left(b - a\right)\right)\right)
\] |
rational_best.json-simplify-43 [=>]0.0 | \[ a + \left(b \cdot -2 + \left(\color{blue}{\left(y \cdot \left(b - z\right) + \left(x + z\right)\right)} + t \cdot \left(b - a\right)\right)\right)
\] |
rational_best.json-simplify-1 [<=]0.0 | \[ a + \left(b \cdot -2 + \left(\left(y \cdot \left(b - z\right) + \color{blue}{\left(z + x\right)}\right) + t \cdot \left(b - a\right)\right)\right)
\] |
rational_best.json-simplify-1 [=>]0.0 | \[ a + \left(b \cdot -2 + \left(\color{blue}{\left(\left(z + x\right) + y \cdot \left(b - z\right)\right)} + t \cdot \left(b - a\right)\right)\right)
\] |
rational_best.json-simplify-2 [=>]0.0 | \[ a + \left(b \cdot -2 + \left(\left(\left(z + x\right) + \color{blue}{\left(b - z\right) \cdot y}\right) + t \cdot \left(b - a\right)\right)\right)
\] |
Final simplification0.0
| Alternative 1 | |
|---|---|
| Error | 37.5 |
| Cost | 2036 |
| Alternative 2 | |
|---|---|
| Error | 37.8 |
| Cost | 2036 |
| Alternative 3 | |
|---|---|
| Error | 29.3 |
| Cost | 1900 |
| Alternative 4 | |
|---|---|
| Error | 25.5 |
| Cost | 1896 |
| Alternative 5 | |
|---|---|
| Error | 28.4 |
| Cost | 1768 |
| Alternative 6 | |
|---|---|
| Error | 28.0 |
| Cost | 1632 |
| Alternative 7 | |
|---|---|
| Error | 16.4 |
| Cost | 1624 |
| Alternative 8 | |
|---|---|
| Error | 19.8 |
| Cost | 1496 |
| Alternative 9 | |
|---|---|
| Error | 8.5 |
| Cost | 1488 |
| Alternative 10 | |
|---|---|
| Error | 22.9 |
| Cost | 1432 |
| Alternative 11 | |
|---|---|
| Error | 17.8 |
| Cost | 1232 |
| Alternative 12 | |
|---|---|
| Error | 7.2 |
| Cost | 1224 |
| Alternative 13 | |
|---|---|
| Error | 7.6 |
| Cost | 1224 |
| Alternative 14 | |
|---|---|
| Error | 34.8 |
| Cost | 1112 |
| Alternative 15 | |
|---|---|
| Error | 27.0 |
| Cost | 848 |
| Alternative 16 | |
|---|---|
| Error | 27.1 |
| Cost | 848 |
| Alternative 17 | |
|---|---|
| Error | 35.2 |
| Cost | 652 |
| Alternative 18 | |
|---|---|
| Error | 44.6 |
| Cost | 592 |
| Alternative 19 | |
|---|---|
| Error | 33.8 |
| Cost | 584 |
| Alternative 20 | |
|---|---|
| Error | 35.8 |
| Cost | 456 |
| Alternative 21 | |
|---|---|
| Error | 33.7 |
| Cost | 456 |
| Alternative 22 | |
|---|---|
| Error | 53.8 |
| Cost | 64 |
herbie shell --seed 2023090
(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)))