?

Average Accuracy: 99.9% → 99.9%
Time: 8.7s
Precision: binary64
Cost: 704

?

\[\left(x \cdot y + z\right) \cdot y + t \]
\[\left(y \cdot \left(x \cdot y\right) + y \cdot z\right) + t \]
(FPCore (x y z t) :precision binary64 (+ (* (+ (* x y) z) y) t))
(FPCore (x y z t) :precision binary64 (+ (+ (* y (* x y)) (* y z)) t))
double code(double x, double y, double z, double t) {
	return (((x * y) + z) * y) + t;
}
double code(double x, double y, double z, double t) {
	return ((y * (x * y)) + (y * z)) + t;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (((x * y) + z) * y) + t
end function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((y * (x * y)) + (y * z)) + t
end function
public static double code(double x, double y, double z, double t) {
	return (((x * y) + z) * y) + t;
}
public static double code(double x, double y, double z, double t) {
	return ((y * (x * y)) + (y * z)) + t;
}
def code(x, y, z, t):
	return (((x * y) + z) * y) + t
def code(x, y, z, t):
	return ((y * (x * y)) + (y * z)) + t
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(x * y) + z) * y) + t)
end
function code(x, y, z, t)
	return Float64(Float64(Float64(y * Float64(x * y)) + Float64(y * z)) + t)
end
function tmp = code(x, y, z, t)
	tmp = (((x * y) + z) * y) + t;
end
function tmp = code(x, y, z, t)
	tmp = ((y * (x * y)) + (y * z)) + t;
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[(N[(y * N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\left(x \cdot y + z\right) \cdot y + t
\left(y \cdot \left(x \cdot y\right) + y \cdot z\right) + t

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 99.9%

    \[\left(x \cdot y + z\right) \cdot y + t \]
  2. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\left(\left(x \cdot y\right) \cdot y + z \cdot y\right)} + t \]
    Proof

    [Start]99.9

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

    *-commutative [=>]99.9

    \[ \color{blue}{y \cdot \left(x \cdot y + z\right)} + t \]

    distribute-rgt-in [=>]99.9

    \[ \color{blue}{\left(\left(x \cdot y\right) \cdot y + z \cdot y\right)} + t \]
  3. Final simplification99.9%

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

Alternatives

Alternative 1
Accuracy77.7%
Cost1243
\[\begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{+182} \lor \neg \left(t \leq -1.55 \cdot 10^{+110}\right) \land \left(t \leq -1.75 \cdot 10^{-139} \lor \neg \left(t \leq 8 \cdot 10^{-238}\right) \land \left(t \leq 5 \cdot 10^{-154} \lor \neg \left(t \leq 4.3 \cdot 10^{-38}\right)\right)\right):\\ \;\;\;\;y \cdot z + t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot y + z\right)\\ \end{array} \]
Alternative 2
Accuracy53.1%
Cost720
\[\begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{+182}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq -1.55 \cdot 10^{+110}:\\ \;\;\;\;y \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;t \leq -1.25 \cdot 10^{-54}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+113}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 3
Accuracy88.0%
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{-43} \lor \neg \left(z \leq 6 \cdot 10^{-76}\right):\\ \;\;\;\;y \cdot z + t\\ \mathbf{else}:\\ \;\;\;\;t + x \cdot \left(y \cdot y\right)\\ \end{array} \]
Alternative 4
Accuracy99.9%
Cost576
\[t + y \cdot \left(x \cdot y + z\right) \]
Alternative 5
Accuracy56.7%
Cost456
\[\begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{-55}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+113}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 6
Accuracy80.7%
Cost452
\[\begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+128}:\\ \;\;\;\;y \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot z + t\\ \end{array} \]
Alternative 7
Accuracy54.2%
Cost64
\[t \]

Error

Reproduce?

herbie shell --seed 2023147 
(FPCore (x y z t)
  :name "Language.Haskell.HsColour.ColourHighlight:unbase from hscolour-1.23"
  :precision binary64
  (+ (* (+ (* x y) z) y) t))