Average Error: 0.1 → 0.1
Time: 40.3s
Precision: binary64
Cost: 576
\[\left(x \cdot y + z\right) \cdot y + t \]
\[t + y \cdot \left(z + x \cdot y\right) \]
(FPCore (x y z t) :precision binary64 (+ (* (+ (* x y) z) y) t))
(FPCore (x y z t) :precision binary64 (+ t (* y (+ z (* x y)))))
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 t + (y * (z + (x * y)));
}
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 = t + (y * (z + (x * y)))
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 t + (y * (z + (x * y)));
}
def code(x, y, z, t):
	return (((x * y) + z) * y) + t
def code(x, y, z, t):
	return t + (y * (z + (x * y)))
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(t + Float64(y * Float64(z + Float64(x * y))))
end
function tmp = code(x, y, z, t)
	tmp = (((x * y) + z) * y) + t;
end
function tmp = code(x, y, z, t)
	tmp = t + (y * (z + (x * y)));
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[(t + N[(y * N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot y + z\right) \cdot y + t
t + y \cdot \left(z + x \cdot y\right)

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. Final simplification0.1

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

Alternatives

Alternative 1
Error25.2
Cost720
\[\begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{-93}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-268}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-240}:\\ \;\;\;\;y \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-114}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
Alternative 2
Error9.5
Cost712
\[\begin{array}{l} t_1 := y \cdot \left(z + x \cdot y\right)\\ \mathbf{if}\;y \leq -4.5 \cdot 10^{-39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+33}:\\ \;\;\;\;t + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error4.6
Cost712
\[\begin{array}{l} t_1 := t + y \cdot z\\ \mathbf{if}\;z \leq -240:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3700000000:\\ \;\;\;\;t + y \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error25.2
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+59}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+169}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
Alternative 5
Error13.6
Cost452
\[\begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{+249}:\\ \;\;\;\;y \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t + y \cdot z\\ \end{array} \]
Alternative 6
Error29.9
Cost64
\[t \]

Error

Reproduce

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