Average Error: 0.0 → 0.0
Time: 4.9s
Precision: binary64
Cost: 704
\[\left(x + y\right) \cdot \left(z + 1\right) \]
\[\left(z + 1\right) \cdot y + \left(z + 1\right) \cdot x \]
(FPCore (x y z) :precision binary64 (* (+ x y) (+ z 1.0)))
(FPCore (x y z) :precision binary64 (+ (* (+ z 1.0) y) (* (+ z 1.0) x)))
double code(double x, double y, double z) {
	return (x + y) * (z + 1.0);
}
double code(double x, double y, double z) {
	return ((z + 1.0) * y) + ((z + 1.0) * 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 = ((z + 1.0d0) * y) + ((z + 1.0d0) * 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 ((z + 1.0) * y) + ((z + 1.0) * x);
}
def code(x, y, z):
	return (x + y) * (z + 1.0)
def code(x, y, z):
	return ((z + 1.0) * y) + ((z + 1.0) * x)
function code(x, y, z)
	return Float64(Float64(x + y) * Float64(z + 1.0))
end
function code(x, y, z)
	return Float64(Float64(Float64(z + 1.0) * y) + Float64(Float64(z + 1.0) * x))
end
function tmp = code(x, y, z)
	tmp = (x + y) * (z + 1.0);
end
function tmp = code(x, y, z)
	tmp = ((z + 1.0) * y) + ((z + 1.0) * x);
end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(N[(N[(z + 1.0), $MachinePrecision] * y), $MachinePrecision] + N[(N[(z + 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]
\left(x + y\right) \cdot \left(z + 1\right)
\left(z + 1\right) \cdot y + \left(z + 1\right) \cdot x

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(z + 1\right) \cdot y + \left(z + 1\right) \cdot x} \]
  3. Final simplification0.0

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

Alternatives

Alternative 1
Error40.4
Cost1380
\[\begin{array}{l} \mathbf{if}\;x \leq -5975658112521703:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -3.6635552285502295 \cdot 10^{-26}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;x \leq -1.2687757937850129 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7.158383172982673 \cdot 10^{-128}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;x \leq -3.128975607685937 \cdot 10^{-159}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -8.532215810813412 \cdot 10^{-235}:\\ \;\;\;\;y\\ \mathbf{elif}\;x \leq -6.1000904002789235 \cdot 10^{-297}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;x \leq 6.524441548579088 \cdot 10^{-249}:\\ \;\;\;\;y\\ \mathbf{elif}\;x \leq 2.2052204904392726 \cdot 10^{-194}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 2
Error12.9
Cost720
\[\begin{array}{l} \mathbf{if}\;z \leq -15.303115969212687:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 270206751336766.94:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+89}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{+160}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
Alternative 3
Error12.3
Cost720
\[\begin{array}{l} t_0 := x + z \cdot x\\ \mathbf{if}\;z \leq -15.303115969212687:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 5.433436965224155 \cdot 10^{-8}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+89}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{+160}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
Alternative 4
Error1.6
Cost712
\[\begin{array}{l} \mathbf{if}\;z \leq -15.303115969212687:\\ \;\;\;\;z \cdot \left(y + x\right)\\ \mathbf{elif}\;z \leq 1.583013194625646 \cdot 10^{-6}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;z \cdot y + z \cdot x\\ \end{array} \]
Alternative 5
Error1.6
Cost584
\[\begin{array}{l} t_0 := z \cdot \left(y + x\right)\\ \mathbf{if}\;z \leq -15.303115969212687:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.583013194625646 \cdot 10^{-6}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error38.9
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq 2.225984573575691 \cdot 10^{-87}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.434344790719922 \cdot 10^{+52}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 7
Error0.0
Cost448
\[\left(z + 1\right) \cdot \left(y + x\right) \]
Alternative 8
Error39.8
Cost196
\[\begin{array}{l} \mathbf{if}\;x \leq -3.128975607685937 \cdot 10^{-159}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 9
Error43.4
Cost64
\[x \]

Error

Reproduce

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