?

Average Error: 0.02% → 0.02%
Time: 4.8s
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.02

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

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

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

Alternatives

Alternative 1
Error50.74%
Cost984
\[\begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq -5.4 \cdot 10^{-61}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-121}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-137}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-263}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.5:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 2
Error50.64%
Cost984
\[\begin{array}{l} \mathbf{if}\;z \leq -0.155:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-60}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{-122}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-137}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-272}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.9:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 3
Error38.08%
Cost717
\[\begin{array}{l} \mathbf{if}\;y \leq 2.6 \cdot 10^{-134}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{-115} \lor \neg \left(y \leq 8 \cdot 10^{-48}\right):\\ \;\;\;\;y \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 4
Error2.73%
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 5
Error20.57%
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 6:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 6
Error20.37%
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-11}:\\ \;\;\;\;y \cdot \left(z + 1\right)\\ \mathbf{elif}\;z \leq 6:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 7
Error0.02%
Cost448
\[\left(y + x\right) \cdot \left(z + 1\right) \]
Alternative 8
Error59.61%
Cost196
\[\begin{array}{l} \mathbf{if}\;y \leq 4.1 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 9
Error66.9%
Cost64
\[x \]

Error

Reproduce?

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