Average Error: 0.0 → 0.0
Time: 5.0s
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 r144070 = x;
        double r144071 = y;
        double r144072 = r144070 + r144071;
        double r144073 = r144070 * r144071;
        double r144074 = r144072 - r144073;
        return r144074;
}

double f(double x, double y) {
        double r144075 = y;
        double r144076 = -r144075;
        double r144077 = x;
        double r144078 = r144077 + r144075;
        double r144079 = fma(r144076, r144077, r144078);
        return r144079;
}

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