Average Error: 0.0 → 0.0
Time: 441.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 r9827 = x;
        double r9828 = y;
        double r9829 = r9827 * r9828;
        double r9830 = r9829 + r9827;
        double r9831 = r9830 + r9828;
        return r9831;
}

double f(double x, double y) {
        double r9832 = x;
        double r9833 = y;
        double r9834 = fma(r9832, r9833, r9832);
        double r9835 = r9834 + r9833;
        return r9835;
}

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