Average Error: 0.0 → 0.0
Time: 433.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 r101464 = x;
        double r101465 = y;
        double r101466 = r101464 * r101465;
        double r101467 = r101466 + r101464;
        double r101468 = r101467 + r101465;
        return r101468;
}

double f(double x, double y) {
        double r101469 = x;
        double r101470 = y;
        double r101471 = fma(r101469, r101470, r101469);
        double r101472 = r101471 + r101470;
        return r101472;
}

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 2020043 +o rules:numerics
(FPCore (x y)
  :name "Numeric.Log:$cexpm1 from log-domain-0.10.2.1, B"
  :precision binary64
  (+ (+ (* x y) x) y))