Average Error: 0.0 → 0.0
Time: 8.0s
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 r124714 = x;
        double r124715 = y;
        double r124716 = r124714 * r124715;
        double r124717 = r124716 + r124714;
        double r124718 = r124717 + r124715;
        return r124718;
}

double f(double x, double y) {
        double r124719 = x;
        double r124720 = y;
        double r124721 = fma(r124719, r124720, r124719);
        double r124722 = r124721 + r124720;
        return r124722;
}

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