Average Error: 0.0 → 0.0
Time: 968.0ms
Precision: 64
\[\left(x \cdot y + x\right) + y\]
\[\mathsf{fma}\left(x, y, x\right) + y\]
\left(x \cdot y + x\right) + y
\mathsf{fma}\left(x, y, x\right) + y
double f(double x, double y) {
        double r66692 = x;
        double r66693 = y;
        double r66694 = r66692 * r66693;
        double r66695 = r66694 + r66692;
        double r66696 = r66695 + r66693;
        return r66696;
}

double f(double x, double y) {
        double r66697 = x;
        double r66698 = y;
        double r66699 = fma(r66697, r66698, r66697);
        double r66700 = r66699 + r66698;
        return r66700;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.0

    \[\left(x \cdot y + x\right) + y\]
  2. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019325 +o rules:numerics
(FPCore (x y)
  :name "Numeric.Log:$cexpm1 from log-domain-0.10.2.1, B"
  :precision binary64
  (+ (+ (* x y) x) y))