Average Error: 0.0 → 0.0
Time: 4.1s
Precision: binary64
Cost: 704
\[\left(x \cdot y + z \cdot t\right) + a \cdot b \]
\[a \cdot b + \left(z \cdot t + x \cdot y\right) \]
(FPCore (x y z t a b) :precision binary64 (+ (+ (* x y) (* z t)) (* a b)))
(FPCore (x y z t a b) :precision binary64 (+ (* a b) (+ (* z t) (* x y))))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * y) + (z * t)) + (a * b);
}
double code(double x, double y, double z, double t, double a, double b) {
	return (a * b) + ((z * t) + (x * y));
}
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) + (z * t)) + (a * 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) + ((z * t) + (x * y))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x * y) + (z * t)) + (a * b);
}
public static double code(double x, double y, double z, double t, double a, double b) {
	return (a * b) + ((z * t) + (x * y));
}
def code(x, y, z, t, a, b):
	return ((x * y) + (z * t)) + (a * b)
def code(x, y, z, t, a, b):
	return (a * b) + ((z * t) + (x * y))
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b))
end
function code(x, y, z, t, a, b)
	return Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x * y) + (z * t)) + (a * b);
end
function tmp = code(x, y, z, t, a, b)
	tmp = (a * b) + ((z * t) + (x * y));
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_] := N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot y + z \cdot t\right) + a \cdot b
a \cdot b + \left(z \cdot t + x \cdot y\right)

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(x \cdot y + z \cdot t\right) + a \cdot b \]
  2. Final simplification0.0

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

Alternatives

Alternative 1
Error30.0
Cost1752
\[\begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.9761330102945274 \cdot 10^{+36}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq -5.313330851374238 \cdot 10^{-70}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -9.043797328819099 \cdot 10^{-163}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -2.849338957755232 \cdot 10^{-211}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 1.7460505636471884 \cdot 10^{-126}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 2.0936144743594102 \cdot 10^{-16}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
Alternative 2
Error14.1
Cost968
\[\begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.9761330102945274 \cdot 10^{+36}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 2.0936144743594102 \cdot 10^{-16}:\\ \;\;\;\;z \cdot t + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
Alternative 3
Error9.2
Cost968
\[\begin{array}{l} t_1 := a \cdot b + z \cdot t\\ \mathbf{if}\;a \cdot b \leq -3.7245213771211815 \cdot 10^{+22}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 2.0936144743594102 \cdot 10^{-16}:\\ \;\;\;\;z \cdot t + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error9.6
Cost968
\[\begin{array}{l} \mathbf{if}\;a \cdot b \leq -3.7245213771211815 \cdot 10^{+22}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 6.325764281842692 \cdot 10^{-20}:\\ \;\;\;\;z \cdot t + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]
Alternative 5
Error30.2
Cost712
\[\begin{array}{l} \mathbf{if}\;a \cdot b \leq -3.7245213771211815 \cdot 10^{+22}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 2.0936144743594102 \cdot 10^{-16}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
Alternative 6
Error41.8
Cost192
\[x \cdot y \]

Error

Reproduce

herbie shell --seed 2022325 
(FPCore (x y z t a b)
  :name "Linear.V3:$cdot from linear-1.19.1.3, B"
  :precision binary64
  (+ (+ (* x y) (* z t)) (* a b)))