Average Error: 0.0 → 0
Time: 6.4s
Precision: 64
\[x \cdot \left(y + 1.0\right)\]
\[\mathsf{fma}\left(x, y, x \cdot 1.0\right)\]
x \cdot \left(y + 1.0\right)
\mathsf{fma}\left(x, y, x \cdot 1.0\right)
double f(double x, double y) {
        double r32318465 = x;
        double r32318466 = y;
        double r32318467 = 1.0;
        double r32318468 = r32318466 + r32318467;
        double r32318469 = r32318465 * r32318468;
        return r32318469;
}

double f(double x, double y) {
        double r32318470 = x;
        double r32318471 = y;
        double r32318472 = 1.0;
        double r32318473 = r32318470 * r32318472;
        double r32318474 = fma(r32318470, r32318471, r32318473);
        return r32318474;
}

Error

Bits error versus x

Bits error versus y

Target

Original0.0
Target0.0
Herbie0
\[x + x \cdot y\]

Derivation

  1. Initial program 0.0

    \[x \cdot \left(y + 1.0\right)\]
  2. Using strategy rm
  3. Applied distribute-lft-in0.0

    \[\leadsto \color{blue}{x \cdot y + x \cdot 1.0}\]
  4. Using strategy rm
  5. Applied fma-def0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, x \cdot 1.0\right)}\]
  6. Final simplification0

    \[\leadsto \mathsf{fma}\left(x, y, x \cdot 1.0\right)\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, B"

  :herbie-target
  (+ x (* x y))

  (* x (+ y 1.0)))