Average Error: 0.0 → 0.0
Time: 931.0ms
Precision: 64
\[\left(x + y\right) - x \cdot y\]
\[\mathsf{fma}\left(1 - x, y, x\right)\]
\left(x + y\right) - x \cdot y
\mathsf{fma}\left(1 - x, y, x\right)
double f(double x, double y) {
        double r204203 = x;
        double r204204 = y;
        double r204205 = r204203 + r204204;
        double r204206 = r204203 * r204204;
        double r204207 = r204205 - r204206;
        return r204207;
}

double f(double x, double y) {
        double r204208 = 1.0;
        double r204209 = x;
        double r204210 = r204208 - r204209;
        double r204211 = y;
        double r204212 = fma(r204210, r204211, r204209);
        return r204212;
}

Error

Bits error versus x

Bits error versus y

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. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(1 - x, y, x\right)\]

Reproduce

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