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

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

Alternatives

Alternative 1
Error11.1
Cost844
\[\begin{array}{l} t_1 := t + y \cdot z\\ \mathbf{if}\;y \leq -9.2 \cdot 10^{+70}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.11962895107888 \cdot 10^{-60}:\\ \;\;\;\;t + x \cdot \left(y \cdot y\right)\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{+70}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z + x \cdot y\right)\\ \end{array} \]
Alternative 2
Error26.6
Cost720
\[\begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+213}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 234777365838892740:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.3000579166173717 \cdot 10^{+85}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 10^{+172}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
Alternative 3
Error5.6
Cost712
\[\begin{array}{l} t_1 := t + y \cdot z\\ \mathbf{if}\;z \leq -2.0823732470884648 \cdot 10^{-77}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 42227493.334573455:\\ \;\;\;\;t + y \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error11.2
Cost580
\[\begin{array}{l} \mathbf{if}\;y \leq 2.6 \cdot 10^{+70}:\\ \;\;\;\;t + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z + x \cdot y\right)\\ \end{array} \]
Alternative 5
Error12.8
Cost452
\[\begin{array}{l} \mathbf{if}\;y \leq 2.6 \cdot 10^{+70}:\\ \;\;\;\;t + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot y\right)\\ \end{array} \]
Alternative 6
Error29.5
Cost64
\[t \]

Error

Reproduce

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