Average Error: 0.0 → 0.0
Time: 5.8s
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 r111315 = x;
        double r111316 = y;
        double r111317 = r111315 * r111316;
        double r111318 = r111317 + r111315;
        double r111319 = r111318 + r111316;
        return r111319;
}

double f(double x, double y) {
        double r111320 = x;
        double r111321 = y;
        double r111322 = fma(r111320, r111321, r111320);
        double r111323 = r111322 + r111321;
        return r111323;
}

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