Average Error: 0.0 → 0.0
Time: 759.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 r88770 = x;
        double r88771 = y;
        double r88772 = r88770 * r88771;
        double r88773 = r88772 + r88770;
        double r88774 = r88773 + r88771;
        return r88774;
}

double f(double x, double y) {
        double r88775 = x;
        double r88776 = 1.0;
        double r88777 = r88775 + r88776;
        double r88778 = y;
        double r88779 = fma(r88777, r88778, r88775);
        return r88779;
}

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