?

Average Error: 0.0 → 0.0
Time: 4.9s
Precision: binary64
Cost: 704

?

\[\left(x + y\right) \cdot \left(z + 1\right) \]
\[\left(\left(x + y\right) + y \cdot z\right) + x \cdot z \]
(FPCore (x y z) :precision binary64 (* (+ x y) (+ z 1.0)))
(FPCore (x y z) :precision binary64 (+ (+ (+ x y) (* y z)) (* x z)))
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) + (y * z)) + (x * z);
}
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) + (y * z)) + (x * z)
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) + (y * z)) + (x * z);
}
def code(x, y, z):
	return (x + y) * (z + 1.0)
def code(x, y, z):
	return ((x + y) + (y * z)) + (x * z)
function code(x, y, z)
	return Float64(Float64(x + y) * Float64(z + 1.0))
end
function code(x, y, z)
	return Float64(Float64(Float64(x + y) + Float64(y * z)) + Float64(x * z))
end
function tmp = code(x, y, z)
	tmp = (x + y) * (z + 1.0);
end
function tmp = code(x, y, z)
	tmp = ((x + y) + (y * z)) + (x * z);
end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(N[(N[(x + y), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]
\left(x + y\right) \cdot \left(z + 1\right)
\left(\left(x + y\right) + y \cdot z\right) + x \cdot z

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

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

Alternatives

Alternative 1
Error31.9
Cost852
\[\begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+170}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{+39}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq -1:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+102}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
Alternative 2
Error13.1
Cost852
\[\begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+170}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -3.95 \cdot 10^{+40}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq -1:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 1.35:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+103}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
Alternative 3
Error1.7
Cost584
\[\begin{array}{l} t_0 := \left(y + x\right) \cdot z\\ \mathbf{if}\;z \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error31.8
Cost456
\[\begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 360000:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
Alternative 5
Error0.0
Cost448
\[\left(x + y\right) \cdot \left(z + 1\right) \]
Alternative 6
Error43.1
Cost64
\[y \]

Error

Reproduce?

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