?

Average Error: 0.0 → 0.0
Time: 19.9s
Precision: binary64
Cost: 1472

?

\[\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 \cdot \left(-1 + t\right) - \left(\left(t + -2\right) \cdot b + y \cdot b\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
 (- (+ x (* z (- 1.0 y))) (- (* a (+ -1.0 t)) (+ (* (+ t -2.0) b) (* y b)))))
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 * (-1.0 + t)) - (((t + -2.0) * b) + (y * b)));
}
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 = (x + (z * (1.0d0 - y))) - ((a * ((-1.0d0) + t)) - (((t + (-2.0d0)) * b) + (y * b)))
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 (x + (z * (1.0 - y))) - ((a * (-1.0 + t)) - (((t + -2.0) * b) + (y * b)));
}
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 (x + (z * (1.0 - y))) - ((a * (-1.0 + t)) - (((t + -2.0) * b) + (y * b)))
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(Float64(a * Float64(-1.0 + t)) - Float64(Float64(Float64(t + -2.0) * b) + Float64(y * b))))
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 = (x + (z * (1.0 - y))) - ((a * (-1.0 + t)) - (((t + -2.0) * b) + (y * b)));
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[(N[(a * N[(-1.0 + t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(t + -2.0), $MachinePrecision] * b), $MachinePrecision] + N[(y * b), $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 \cdot \left(-1 + t\right) - \left(\left(t + -2\right) \cdot b + y \cdot b\right)\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 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 \]
  2. Simplified0.0

    \[\leadsto \color{blue}{\left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + -1\right) \cdot a - \left(y + \left(t - 2\right)\right) \cdot b\right)} \]
    Proof

    [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) \]
  3. Applied egg-rr0.0

    \[\leadsto \left(x - \left(y + -1\right) \cdot z\right) - \left(\left(t + -1\right) \cdot a - \color{blue}{\left(\left(t + -2\right) \cdot b + y \cdot b\right)}\right) \]
  4. Final simplification0.0

    \[\leadsto \left(x + z \cdot \left(1 - y\right)\right) - \left(a \cdot \left(-1 + t\right) - \left(\left(t + -2\right) \cdot b + y \cdot b\right)\right) \]

Alternatives

Alternative 1
Error21.1
Cost1496
\[\begin{array}{l} t_1 := z \cdot \left(1 - y\right)\\ t_2 := a \cdot \left(1 - t\right)\\ t_3 := x + \left(z + t_2\right)\\ t_4 := a + \left(x + b \cdot \left(-2 + \left(y + t\right)\right)\right)\\ \mathbf{if}\;a \leq -2 \cdot 10^{+62}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-253}:\\ \;\;\;\;x + \left(t_1 - t \cdot a\right)\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-76}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-15}:\\ \;\;\;\;x + t_1\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+71}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{+204}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\left(x + y \cdot b\right) + t_2\\ \end{array} \]
Alternative 2
Error0.0
Cost1344
\[\left(\left(x + z \cdot \left(1 - y\right)\right) + a \cdot \left(1 - t\right)\right) + b \cdot \left(-2 + \left(y + t\right)\right) \]
Alternative 3
Error32.1
Cost1241
\[\begin{array}{l} t_1 := b \cdot \left(-2 + \left(y + t\right)\right)\\ t_2 := z + \left(x + a\right)\\ \mathbf{if}\;x \leq -1 \cdot 10^{-49}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2.15 \cdot 10^{-100}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-195}:\\ \;\;\;\;z \cdot \left(1 - y\right)\\ \mathbf{elif}\;x \leq -2.2 \cdot 10^{-245} \lor \neg \left(x \leq 2.15 \cdot 10^{-51}\right) \land x \leq 6 \cdot 10^{-7}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error7.8
Cost1225
\[\begin{array}{l} t_1 := a \cdot \left(1 - t\right)\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+38} \lor \neg \left(z \leq 1.25 \cdot 10^{-36}\right):\\ \;\;\;\;x + \left(t_1 + z \cdot \left(1 - y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + b \cdot \left(-2 + \left(y + t\right)\right)\right) + t_1\\ \end{array} \]
Alternative 5
Error10.6
Cost1097
\[\begin{array}{l} \mathbf{if}\;b \leq -2.25 \cdot 10^{+66} \lor \neg \left(b \leq 3.1 \cdot 10^{+108}\right):\\ \;\;\;\;a + \left(x + b \cdot \left(-2 + \left(y + t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(a \cdot \left(1 - t\right) + z \cdot \left(1 - y\right)\right)\\ \end{array} \]
Alternative 6
Error20.4
Cost969
\[\begin{array}{l} \mathbf{if}\;a \leq -1.45 \cdot 10^{+61} \lor \neg \left(a \leq 2 \cdot 10^{+28}\right):\\ \;\;\;\;x + \left(z + a \cdot \left(1 - t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(z \cdot \left(1 - y\right) - t \cdot a\right)\\ \end{array} \]
Alternative 7
Error20.8
Cost968
\[\begin{array}{l} t_1 := a \cdot \left(1 - t\right)\\ \mathbf{if}\;a \leq -4.4 \cdot 10^{+56}:\\ \;\;\;\;x + \left(z + t_1\right)\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{+28}:\\ \;\;\;\;x + \left(z \cdot \left(1 - y\right) - t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + y \cdot b\right) + t_1\\ \end{array} \]
Alternative 8
Error34.1
Cost850
\[\begin{array}{l} \mathbf{if}\;a \leq -3.6 \cdot 10^{+140} \lor \neg \left(a \leq 2.95 \cdot 10^{+87}\right) \land \left(a \leq 8.2 \cdot 10^{+145} \lor \neg \left(a \leq 3.8 \cdot 10^{+180}\right)\right):\\ \;\;\;\;a \cdot \left(1 - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
Alternative 9
Error28.6
Cost848
\[\begin{array}{l} t_1 := z + \left(x + a\right)\\ t_2 := b \cdot \left(y + -2\right)\\ \mathbf{if}\;b \leq -1.5 \cdot 10^{+198}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{-219}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{-188}:\\ \;\;\;\;x - t \cdot a\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{+143}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error23.1
Cost841
\[\begin{array}{l} \mathbf{if}\;a \leq -2.05 \cdot 10^{+52} \lor \neg \left(a \leq 3.6 \cdot 10^{+26}\right):\\ \;\;\;\;x + \left(z + a \cdot \left(1 - t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(1 - y\right)\\ \end{array} \]
Alternative 11
Error44.4
Cost724
\[\begin{array}{l} \mathbf{if}\;x \leq -1.06 \cdot 10^{-41}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-288}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-250}:\\ \;\;\;\;a\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{-191}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{+15}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 12
Error35.4
Cost720
\[\begin{array}{l} \mathbf{if}\;a \leq -6 \cdot 10^{+202}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;a \leq -1.8 \cdot 10^{+148}:\\ \;\;\;\;t \cdot \left(-a\right)\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{+45}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;a \leq 2.3 \cdot 10^{+150}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;x + a\\ \end{array} \]
Alternative 13
Error25.8
Cost713
\[\begin{array}{l} \mathbf{if}\;a \leq -1.85 \cdot 10^{+52} \lor \neg \left(a \leq 2.06 \cdot 10^{+86}\right):\\ \;\;\;\;x + a \cdot \left(1 - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(1 - y\right)\\ \end{array} \]
Alternative 14
Error27.8
Cost712
\[\begin{array}{l} \mathbf{if}\;a \leq -7.2 \cdot 10^{+140}:\\ \;\;\;\;a - t \cdot a\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+28}:\\ \;\;\;\;x + z \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z + \left(x + a\right)\\ \end{array} \]
Alternative 15
Error27.7
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+81} \lor \neg \left(y \leq 2.75 \cdot 10^{+57}\right):\\ \;\;\;\;y \cdot \left(b - z\right)\\ \mathbf{else}:\\ \;\;\;\;z + \left(x + a\right)\\ \end{array} \]
Alternative 16
Error36.4
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -8.6 \cdot 10^{+172}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+214}:\\ \;\;\;\;x + a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
Alternative 17
Error34.8
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -6.2 \cdot 10^{+45}:\\ \;\;\;\;x + a\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{+150}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;x + a\\ \end{array} \]
Alternative 18
Error44.6
Cost328
\[\begin{array}{l} \mathbf{if}\;a \leq -6.5 \cdot 10^{+140}:\\ \;\;\;\;a\\ \mathbf{elif}\;a \leq 4.4 \cdot 10^{+180}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 19
Error53.9
Cost64
\[a \]

Error

Reproduce?

herbie shell --seed 2023018 
(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)))