Average Error: 0.1 → 0.1
Time: 7.5s
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
Error25.8
Cost984
\[\begin{array}{l} t_1 := y \cdot \left(x \cdot y\right)\\ \mathbf{if}\;t \leq -3.257442775400132 \cdot 10^{-79}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq 2.0461205227154176 \cdot 10^{-229}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;t \leq 1.9282024663912063 \cdot 10^{-165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.7229447038234774 \cdot 10^{-114}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;t \leq 6.309788258062418 \cdot 10^{-67}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.6949710219950935 \cdot 10^{-46}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 2
Error25.7
Cost720
\[\begin{array}{l} \mathbf{if}\;t \leq -3.257442775400132 \cdot 10^{-79}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq 2.0461205227154176 \cdot 10^{-229}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;t \leq 1.9282024663912063 \cdot 10^{-165}:\\ \;\;\;\;x \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;t \leq 1.936231027305437 \cdot 10^{-95}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 3
Error13.8
Cost716
\[\begin{array}{l} t_1 := t + y \cdot z\\ t_2 := y \cdot \left(x \cdot y\right)\\ \mathbf{if}\;y \leq 1024955.113786615:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+26}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.52 \cdot 10^{+54}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error9.7
Cost712
\[\begin{array}{l} t_1 := y \cdot \left(z + x \cdot y\right)\\ \mathbf{if}\;y \leq -1.95 \cdot 10^{+87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.144752934837097 \cdot 10^{-13}:\\ \;\;\;\;t + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error5.0
Cost712
\[\begin{array}{l} t_1 := t + y \cdot z\\ \mathbf{if}\;z \leq -1849051290919909600:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.797961030596841 \cdot 10^{+41}:\\ \;\;\;\;t + y \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error0.1
Cost576
\[t + y \cdot \left(z + x \cdot y\right) \]
Alternative 7
Error25.2
Cost456
\[\begin{array}{l} \mathbf{if}\;t \leq -3.257442775400132 \cdot 10^{-79}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq 1.936231027305437 \cdot 10^{-95}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 8
Error30.0
Cost64
\[t \]

Error

Reproduce

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