Average Error: 0.0 → 0.0
Time: 791.0ms
Precision: 64
\[\left(x \cdot y + x\right) + y\]
\[\mathsf{fma}\left(x + 1, y, x\right)\]
\left(x \cdot y + x\right) + y
\mathsf{fma}\left(x + 1, y, x\right)
double f(double x, double y) {
        double r97791 = x;
        double r97792 = y;
        double r97793 = r97791 * r97792;
        double r97794 = r97793 + r97791;
        double r97795 = r97794 + r97792;
        return r97795;
}

double f(double x, double y) {
        double r97796 = x;
        double r97797 = 1.0;
        double r97798 = r97796 + r97797;
        double r97799 = y;
        double r97800 = fma(r97798, r97799, r97796);
        return r97800;
}

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}{y + \mathsf{fma}\left(x, y, x\right)}\]
  3. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{x + \left(y + x \cdot y\right)}\]
  4. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x + 1, y, x\right)}\]
  5. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(x + 1, y, x\right)\]

Reproduce

herbie shell --seed 2019346 +o rules:numerics
(FPCore (x y)
  :name "Numeric.Log:$cexpm1 from log-domain-0.10.2.1, B"
  :precision binary64
  (+ (+ (* x y) x) y))