Average Error: 0.0 → 0.0
Time: 7.1s
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 r71281 = x;
        double r71282 = y;
        double r71283 = r71281 * r71282;
        double r71284 = r71283 + r71281;
        double r71285 = r71284 + r71282;
        return r71285;
}

double f(double x, double y) {
        double r71286 = x;
        double r71287 = y;
        double r71288 = fma(r71286, r71287, r71286);
        double r71289 = r71288 + r71287;
        return r71289;
}

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