?

Average Error: 0.0 → 0.0
Time: 4.3s
Precision: binary64
Cost: 576

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.0

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

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

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

Alternatives

Alternative 1
Error32.7
Cost1248
\[\begin{array}{l} \mathbf{if}\;z \leq -7200000000:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-131}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-198}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-306}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-222}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-141}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-60}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 0.0002:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 2
Error12.8
Cost716
\[\begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-8}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+76}:\\ \;\;\;\;y \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 3
Error1.7
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\ \;\;\;\;z \cdot \left(y + x\right)\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 4
Error23.9
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -5.6 \cdot 10^{-63}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-98}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(z + 1\right)\\ \end{array} \]
Alternative 5
Error12.9
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq 78000:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 6
Error0.0
Cost448
\[\left(y + x\right) \cdot \left(z + 1\right) \]
Alternative 7
Error38.6
Cost196
\[\begin{array}{l} \mathbf{if}\;x \leq -9.5 \cdot 10^{-64}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 8
Error43.4
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023187 
(FPCore (x y z)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, G"
  :precision binary64
  (* (+ x y) (+ z 1.0)))