Average Error: 0.0 → 0.0
Time: 3.6s
Precision: 64
\[\left(x + y\right) - x \cdot y\]
\[x + \left(y - x \cdot y\right)\]
\left(x + y\right) - x \cdot y
x + \left(y - x \cdot y\right)
double f(double x, double y) {
        double r254717 = x;
        double r254718 = y;
        double r254719 = r254717 + r254718;
        double r254720 = r254717 * r254718;
        double r254721 = r254719 - r254720;
        return r254721;
}

double f(double x, double y) {
        double r254722 = x;
        double r254723 = y;
        double r254724 = r254722 * r254723;
        double r254725 = r254723 - r254724;
        double r254726 = r254722 + r254725;
        return r254726;
}

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 associate--l+0.0

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

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

Reproduce

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