Average Error: 0.0 → 0.0
Time: 1.7s
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 r328738 = x;
        double r328739 = y;
        double r328740 = r328738 + r328739;
        double r328741 = r328738 * r328739;
        double r328742 = r328740 - r328741;
        return r328742;
}

double f(double x, double y) {
        double r328743 = x;
        double r328744 = y;
        double r328745 = r328743 * r328744;
        double r328746 = r328744 - r328745;
        double r328747 = r328743 + r328746;
        return r328747;
}

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 2020056 
(FPCore (x y)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, A"
  :precision binary64
  (- (+ x y) (* x y)))