Average Error: 0.0 → 0.0
Time: 9.5s
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 r88494 = x;
        double r88495 = y;
        double r88496 = r88494 * r88495;
        double r88497 = r88496 + r88494;
        double r88498 = r88497 + r88495;
        return r88498;
}

double f(double x, double y) {
        double r88499 = x;
        double r88500 = y;
        double r88501 = fma(r88499, r88500, r88499);
        double r88502 = r88501 + r88500;
        return r88502;
}

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