Average Error: 0.0 → 0.0
Time: 7.9s
Precision: 64
\[\left(x + y\right) - x \cdot y\]
\[x + \left(y - y \cdot x\right)\]
\left(x + y\right) - x \cdot y
x + \left(y - y \cdot x\right)
double f(double x, double y) {
        double r9275998 = x;
        double r9275999 = y;
        double r9276000 = r9275998 + r9275999;
        double r9276001 = r9275998 * r9275999;
        double r9276002 = r9276000 - r9276001;
        return r9276002;
}

double f(double x, double y) {
        double r9276003 = x;
        double r9276004 = y;
        double r9276005 = r9276004 * r9276003;
        double r9276006 = r9276004 - r9276005;
        double r9276007 = r9276003 + r9276006;
        return r9276007;
}

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. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(1 - x, y, x\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.0

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

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

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, A"
  (- (+ x y) (* x y)))