?

Average Accuracy: 100.0% → 100.0%
Time: 2.8s
Precision: binary64
Cost: 448

?

\[\left(x + y\right) - x \cdot y \]
\[y + \left(x - x \cdot y\right) \]
(FPCore (x y) :precision binary64 (- (+ x y) (* x y)))
(FPCore (x y) :precision binary64 (+ y (- x (* x y))))
double code(double x, double y) {
	return (x + y) - (x * y);
}
double code(double x, double y) {
	return y + (x - (x * y));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (x + y) - (x * y)
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = y + (x - (x * y))
end function
public static double code(double x, double y) {
	return (x + y) - (x * y);
}
public static double code(double x, double y) {
	return y + (x - (x * y));
}
def code(x, y):
	return (x + y) - (x * y)
def code(x, y):
	return y + (x - (x * y))
function code(x, y)
	return Float64(Float64(x + y) - Float64(x * y))
end
function code(x, y)
	return Float64(y + Float64(x - Float64(x * y)))
end
function tmp = code(x, y)
	tmp = (x + y) - (x * y);
end
function tmp = code(x, y)
	tmp = y + (x - (x * y));
end
code[x_, y_] := N[(N[(x + y), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(y + N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x + y\right) - x \cdot y
y + \left(x - x \cdot y\right)

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) - x \cdot y \]
  2. Applied egg-rr100.0%

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

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

Alternatives

Alternative 1
Accuracy84.1%
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -1.12 \cdot 10^{+18}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-23}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y - x \cdot y\\ \end{array} \]
Alternative 2
Accuracy84.7%
Cost520
\[\begin{array}{l} \mathbf{if}\;x \leq -1.12 \cdot 10^{+18}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;x \leq 880000:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
Alternative 3
Accuracy84.7%
Cost520
\[\begin{array}{l} \mathbf{if}\;x \leq -1.12 \cdot 10^{+18}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{elif}\;x \leq 880000:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
Alternative 4
Accuracy55.5%
Cost460
\[\begin{array}{l} \mathbf{if}\;x \leq -5.1 \cdot 10^{-70}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.06 \cdot 10^{-115}:\\ \;\;\;\;y\\ \mathbf{elif}\;x \leq -1.75 \cdot 10^{-144}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 5
Accuracy78.2%
Cost388
\[\begin{array}{l} \mathbf{if}\;x \leq 880000:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
Alternative 6
Accuracy84.7%
Cost192
\[x + y \]
Alternative 7
Accuracy42.9%
Cost64
\[x \]

Error

Reproduce?

herbie shell --seed 2023129 
(FPCore (x y)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, A"
  :precision binary64
  (- (+ x y) (* x y)))