Average Error: 0.1 → 0.1
Time: 10.2s
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 0.1

    \[\left(x \cdot y + z\right) \cdot y + t \]
  2. Applied egg-rr0.1

    \[\leadsto \color{blue}{\left(\left(x \cdot y\right) \cdot y + z \cdot y\right)} + t \]
  3. Final simplification0.1

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

Alternatives

Alternative 1
Error12.5
Cost1108
\[\begin{array}{l} t_1 := y \cdot \left(x \cdot y + z\right)\\ t_2 := t + y \cdot z\\ \mathbf{if}\;t \leq -4.959385800530276 \cdot 10^{+44}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1.6069934447118557 \cdot 10^{-65}:\\ \;\;\;\;t + x \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;t \leq -8.35570235170745 \cdot 10^{-90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.8044151725848973 \cdot 10^{-232}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 2.3358121268724357 \cdot 10^{-113}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error25.2
Cost720
\[\begin{array}{l} \mathbf{if}\;t \leq -2.6142807226805107 \cdot 10^{-75}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq 1.6546399022149054 \cdot 10^{-117}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;t \leq 1.980149922310444 \cdot 10^{-51}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq 1.0177127986932875 \cdot 10^{-37}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 3
Error7.9
Cost712
\[\begin{array}{l} t_1 := t + y \cdot z\\ \mathbf{if}\;z \leq -262.3362583228705:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 8.736178620154878 \cdot 10^{-55}:\\ \;\;\;\;t + x \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error5.2
Cost712
\[\begin{array}{l} t_1 := t + y \cdot z\\ \mathbf{if}\;z \leq -262.3362583228705:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.3635984051604335 \cdot 10^{+62}:\\ \;\;\;\;y \cdot \left(x \cdot y\right) + t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error13.5
Cost584
\[\begin{array}{l} t_1 := t + y \cdot z\\ \mathbf{if}\;y \leq -1.75 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{+27}:\\ \;\;\;\;x \cdot \left(y \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error0.1
Cost576
\[t + y \cdot \left(x \cdot y + z\right) \]
Alternative 7
Error30.1
Cost64
\[t \]

Error

Reproduce

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