Average Error: 0.0 → 0.0
Time: 1.2s
Precision: binary64
Cost: 448
\[\left(x + y\right) - x \cdot y\]
\[\left(y + x\right) - y \cdot x\]
\left(x + y\right) - x \cdot y
\left(y + x\right) - y \cdot x
(FPCore (x y) :precision binary64 (- (+ x y) (* x y)))
(FPCore (x y) :precision binary64 (- (+ y x) (* y x)))
double code(double x, double y) {
	return (x + y) - (x * y);
}
double code(double x, double y) {
	return (y + x) - (y * x);
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error9.3
Cost648
\[\begin{array}{l} \mathbf{if}\;x \leq -0.00016384802750474183 \lor \neg \left(x \leq 1.2359966933503235 \cdot 10^{-35}\right):\\ \;\;\;\;x - y \cdot x\\ \mathbf{else}:\\ \;\;\;\;y - y \cdot x\\ \end{array}\]
Alternative 2
Error9.8
Cost648
\[\begin{array}{l} \mathbf{if}\;y \leq -1.9759430105002514 \cdot 10^{-28} \lor \neg \left(y \leq 1.0513330107057813 \cdot 10^{-78}\right):\\ \;\;\;\;y - y \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 3
Error18.3
Cost706
\[\begin{array}{l} \mathbf{if}\;x \leq -3.186213298375729 \cdot 10^{-05}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 5.6462970633207215 \cdot 10^{-43}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 4
Error36.0
Cost64
\[x\]
Alternative 5
Error61.7
Cost64
\[-1\]
Alternative 6
Error61.9
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[\left(x + y\right) - x \cdot y\]
  2. Simplified0.0

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

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

Reproduce

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