Average Error: 0.0 → 0.0
Time: 6.1s
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 r9230900 = x;
        double r9230901 = y;
        double r9230902 = r9230900 + r9230901;
        double r9230903 = r9230900 * r9230901;
        double r9230904 = r9230902 - r9230903;
        return r9230904;
}

double f(double x, double y) {
        double r9230905 = x;
        double r9230906 = y;
        double r9230907 = r9230906 * r9230905;
        double r9230908 = r9230906 - r9230907;
        double r9230909 = r9230905 + r9230908;
        return r9230909;
}

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)))