Average Error: 0.0 → 0.0
Time: 5.1s
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 r194176 = x;
        double r194177 = y;
        double r194178 = r194176 + r194177;
        double r194179 = r194176 * r194177;
        double r194180 = r194178 - r194179;
        return r194180;
}

double f(double x, double y) {
        double r194181 = 1.0;
        double r194182 = x;
        double r194183 = r194181 - r194182;
        double r194184 = y;
        double r194185 = fma(r194183, r194184, r194182);
        return r194185;
}

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