Average Error: 0 → 0
Time: 590.0ms
Precision: 64
\[\left(\left(\left(x + x\right) + x\right) + x\right) + x\]
\[\mathsf{fma}\left(x, 4, x\right)\]
\left(\left(\left(x + x\right) + x\right) + x\right) + x
\mathsf{fma}\left(x, 4, x\right)
double f(double x) {
        double r100623 = x;
        double r100624 = r100623 + r100623;
        double r100625 = r100624 + r100623;
        double r100626 = r100625 + r100623;
        double r100627 = r100626 + r100623;
        return r100627;
}

double f(double x) {
        double r100628 = x;
        double r100629 = 4.0;
        double r100630 = fma(r100628, r100629, r100628);
        return r100630;
}

Error

Bits error versus x

Derivation

  1. Initial program 0

    \[\left(\left(\left(x + x\right) + x\right) + x\right) + x\]
  2. Simplified0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, 4, x\right)}\]
  3. Final simplification0

    \[\leadsto \mathsf{fma}\left(x, 4, x\right)\]

Reproduce

herbie shell --seed 2020001 +o rules:numerics
(FPCore (x)
  :name "Main:i from "
  :precision binary64
  (+ (+ (+ (+ x x) x) x) x))