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

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

Alternatives

Alternative 1
Error32.0
Cost1620
\[\begin{array}{l} t_0 := z \cdot \left(-y\right)\\ t_1 := x - x \cdot z\\ \mathbf{if}\;1 - z \leq -2 \cdot 10^{+152}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;1 - z \leq 1:\\ \;\;\;\;t_1\\ \mathbf{elif}\;1 - z \leq 2:\\ \;\;\;\;x + y\\ \mathbf{elif}\;1 - z \leq 5 \cdot 10^{+99}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;1 - z \leq 5 \cdot 10^{+179}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error26.5
Cost1244
\[\begin{array}{l} t_0 := y \cdot \left(1 - z\right)\\ t_1 := x - x \cdot z\\ \mathbf{if}\;x \leq -1.251181739311937 \cdot 10^{-11}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.607358152156033 \cdot 10^{-75}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x \leq -1.4126622697240717 \cdot 10^{-98}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -9.654080820176135 \cdot 10^{-147}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.758473611016117 \cdot 10^{-183}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.2621802846860282 \cdot 10^{-207}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -3.574214940949239 \cdot 10^{-226}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error13.1
Cost916
\[\begin{array}{l} t_0 := z \cdot \left(-y\right)\\ t_1 := z \cdot \left(-x\right)\\ \mathbf{if}\;z \leq -2.7 \cdot 10^{+179}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -9.8 \cdot 10^{+101}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1522577718.922361:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 0.24206959902655423:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+152}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error1.8
Cost904
\[\begin{array}{l} t_0 := z \cdot \left(\left(-y\right) - x\right)\\ \mathbf{if}\;1 - z \leq -1000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;1 - z \leq 2:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error13.1
Cost520
\[\begin{array}{l} t_0 := z \cdot \left(-y\right)\\ \mathbf{if}\;z \leq -1522577718.922361:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 0.24206959902655423:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error23.6
Cost192
\[x + y \]
Alternative 7
Error43.3
Cost64
\[x \]

Error

Reproduce

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