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

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

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

Alternatives

Alternative 1
Error14.6
Cost652
\[\begin{array}{l} t_0 := y \cdot \left(-x\right)\\ \mathbf{if}\;x \leq -8.2 \cdot 10^{+42}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;x \leq -3.51142220532421 \cdot 10^{+35}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 3.5793913177223256 \cdot 10^{-9}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error9.4
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -127515.30635615981:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq 1.1235350116764837 \cdot 10^{-6}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 - x\right)\\ \end{array} \]
Alternative 3
Error12.8
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -1.459491780447495 \cdot 10^{+19}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{elif}\;x \leq 8.724427047837277 \cdot 10^{-120}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 - x\right)\\ \end{array} \]
Alternative 4
Error28.1
Cost460
\[\begin{array}{l} \mathbf{if}\;x \leq -1.9230384576028763 \cdot 10^{-76}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -3.4145480434897896 \cdot 10^{-107}:\\ \;\;\;\;y\\ \mathbf{elif}\;x \leq -1.4503395930784335 \cdot 10^{-127}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 5
Error9.3
Cost192
\[y + x \]
Alternative 6
Error36.0
Cost64
\[x \]

Error

Reproduce

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