Average Error: 0.0 → 0.0
Time: 883.0ms
Precision: 64
\[\left(x + y\right) - x \cdot y\]
\[y + x \cdot \left(1 - y\right)\]
\left(x + y\right) - x \cdot y
y + x \cdot \left(1 - y\right)
double code(double x, double y) {
	return ((double) (((double) (x + y)) - ((double) (x * y))));
}
double code(double x, double y) {
	return ((double) (y + ((double) (x * ((double) (1.0 - y))))));
}

Error

Bits error versus x

Bits error versus y

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. Using strategy rm
  3. Applied +-commutative0.0

    \[\leadsto \color{blue}{\left(y + x\right)} - x \cdot y\]
  4. Applied associate--l+0.0

    \[\leadsto \color{blue}{y + \left(x - x \cdot y\right)}\]
  5. Using strategy rm
  6. Applied *-commutative0.0

    \[\leadsto y + \left(x - \color{blue}{y \cdot x}\right)\]
  7. Applied *-un-lft-identity0.0

    \[\leadsto y + \left(\color{blue}{1 \cdot x} - y \cdot x\right)\]
  8. Applied distribute-rgt-out--0.0

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

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

Reproduce

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