Average Error: 0.0 → 0.0
Time: 5.2s
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.3
Cost1116
\[\begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-269}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-257}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-204}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-144}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 0.17:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+153}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 2
Error32.1
Cost984
\[\begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-269}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-269}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-208}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{-144}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 3
Error24.1
Cost717
\[\begin{array}{l} \mathbf{if}\;y \leq 1.6 \cdot 10^{-93}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-25} \lor \neg \left(y \leq 1.4 \cdot 10^{+46}\right):\\ \;\;\;\;y \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 4
Error12.6
Cost716
\[\begin{array}{l} t_0 := y \cdot \left(z + 1\right)\\ \mathbf{if}\;z \leq -4.4 \cdot 10^{-14}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-5}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 5
Error13.1
Cost588
\[\begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 1.05:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+155}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
Alternative 6
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 7
Error38.0
Cost460
\[\begin{array}{l} \mathbf{if}\;y \leq 1.65 \cdot 10^{-74}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-48}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-10}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 8
Error0.0
Cost448
\[\left(y + x\right) \cdot \left(z + 1\right) \]
Alternative 9
Error42.9
Cost64
\[x \]

Error

Reproduce

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