?

Average Accuracy: 100.0% → 100.0%
Time: 4.1s
Precision: binary64
Cost: 704

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 100.0%

    \[\left(x + y\right) \cdot \left(1 - z\right) \]
  2. Taylor expanded in x around 0 100.0%

    \[\leadsto \color{blue}{\left(1 - z\right) \cdot x + y \cdot \left(1 - z\right)} \]
  3. Final simplification100.0%

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

Alternatives

Alternative 1
Accuracy81.0%
Cost1360
\[\begin{array}{l} t_0 := z \cdot \left(-x\right)\\ \mathbf{if}\;1 - z \leq -5 \cdot 10^{+212}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{elif}\;1 - z \leq -40:\\ \;\;\;\;t_0\\ \mathbf{elif}\;1 - z \leq 1:\\ \;\;\;\;x + y\\ \mathbf{elif}\;1 - z \leq 5 \cdot 10^{+141}:\\ \;\;\;\;\left(1 - z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Accuracy81.3%
Cost1360
\[\begin{array}{l} \mathbf{if}\;1 - z \leq -5 \cdot 10^{+212}:\\ \;\;\;\;z \cdot \left(-y\right)\\ \mathbf{elif}\;1 - z \leq 0.9:\\ \;\;\;\;\left(1 - z\right) \cdot x\\ \mathbf{elif}\;1 - z \leq 1:\\ \;\;\;\;x + y\\ \mathbf{elif}\;1 - z \leq 5 \cdot 10^{+141}:\\ \;\;\;\;\left(1 - z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \end{array} \]
Alternative 3
Accuracy97.3%
Cost905
\[\begin{array}{l} \mathbf{if}\;1 - z \leq -40 \lor \neg \left(1 - z \leq 2\right):\\ \;\;\;\;z \cdot \left(\left(-y\right) - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 4
Accuracy80.8%
Cost784
\[\begin{array}{l} t_0 := z \cdot \left(-x\right)\\ t_1 := z \cdot \left(-y\right)\\ \mathbf{if}\;z \leq -6.6 \cdot 10^{+141}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -250000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+212}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Accuracy80.8%
Cost521
\[\begin{array}{l} \mathbf{if}\;z \leq -180 \lor \neg \left(z \leq 1\right):\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 6
Accuracy100.0%
Cost448
\[\left(1 - z\right) \cdot \left(x + y\right) \]
Alternative 7
Accuracy64.4%
Cost192
\[x + y \]

Error

Reproduce?

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