Average Error: 0.0 → 0.0
Time: 5.8s
Precision: 64
\[\left(x + y\right) - x \cdot y\]
\[\mathsf{fma}\left(-y, x, x + y\right)\]
\left(x + y\right) - x \cdot y
\mathsf{fma}\left(-y, x, x + y\right)
double f(double x, double y) {
        double r170220 = x;
        double r170221 = y;
        double r170222 = r170220 + r170221;
        double r170223 = r170220 * r170221;
        double r170224 = r170222 - r170223;
        return r170224;
}

double f(double x, double y) {
        double r170225 = y;
        double r170226 = -r170225;
        double r170227 = x;
        double r170228 = r170227 + r170225;
        double r170229 = fma(r170226, r170227, r170228);
        return r170229;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.0

    \[\left(x + y\right) - x \cdot y\]
  2. Using strategy rm
  3. Applied add-cube-cbrt1.2

    \[\leadsto \color{blue}{\left(\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}\right) \cdot \sqrt[3]{x + y}} - x \cdot y\]
  4. Applied prod-diff1.2

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}, \sqrt[3]{x + y}, -y \cdot x\right) + \mathsf{fma}\left(-y, x, y \cdot x\right)}\]
  5. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(-y, x, x + y\right)} + \mathsf{fma}\left(-y, x, y \cdot x\right)\]
  6. Simplified0.0

    \[\leadsto \mathsf{fma}\left(-y, x, x + y\right) + \color{blue}{0}\]
  7. Final simplification0.0

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

Reproduce

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