?

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

    \[\left(x + y\right) \cdot \left(1 - z\right) \]
  2. Final simplification0.02

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

Alternatives

Alternative 1
Error2.74%
Cost905
\[\begin{array}{l} \mathbf{if}\;1 - z \leq -5 \lor \neg \left(1 - z \leq 2\right):\\ \;\;\;\;z \cdot \left(\left(-x\right) - y\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 2
Error38.09%
Cost717
\[\begin{array}{l} \mathbf{if}\;y \leq 2.6 \cdot 10^{-134}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-115} \lor \neg \left(y \leq 8 \cdot 10^{-48}\right):\\ \;\;\;\;y \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 3
Error38.09%
Cost716
\[\begin{array}{l} \mathbf{if}\;y \leq 2.9 \cdot 10^{-134}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-115}:\\ \;\;\;\;y \cdot \left(1 - z\right)\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-48}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y - y \cdot z\\ \end{array} \]
Alternative 4
Error20.49%
Cost521
\[\begin{array}{l} \mathbf{if}\;z \leq -32 \lor \neg \left(z \leq 1\right):\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 5
Error20.55%
Cost520
\[\begin{array}{l} \mathbf{if}\;z \leq -125:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \end{array} \]
Alternative 6
Error20.38%
Cost520
\[\begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{-11}:\\ \;\;\;\;y \cdot \left(1 - z\right)\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \end{array} \]
Alternative 7
Error59.64%
Cost196
\[\begin{array}{l} \mathbf{if}\;y \leq 8.8 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 8
Error36.76%
Cost192
\[x + y \]
Alternative 9
Error66.91%
Cost64
\[x \]

Error

Reproduce?

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