Average Error: 0.0 → 0.0
Time: 6.3s
Precision: 64
\[\left(x + y\right) - x \cdot y\]
\[\mathsf{fma}\left(y, 1 - x, x\right)\]
\left(x + y\right) - x \cdot y
\mathsf{fma}\left(y, 1 - x, x\right)
double f(double x, double y) {
        double r254031 = x;
        double r254032 = y;
        double r254033 = r254031 + r254032;
        double r254034 = r254031 * r254032;
        double r254035 = r254033 - r254034;
        return r254035;
}

double f(double x, double y) {
        double r254036 = y;
        double r254037 = 1.0;
        double r254038 = x;
        double r254039 = r254037 - r254038;
        double r254040 = fma(r254036, r254039, r254038);
        return r254040;
}

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(y, 1 - x, x\right)}\]
  3. Final simplification0.0

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

Reproduce

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