Average Error: 0 → 0
Time: 565.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 r116795 = x;
        double r116796 = r116795 + r116795;
        double r116797 = r116796 + r116795;
        double r116798 = r116797 + r116795;
        double r116799 = r116798 + r116795;
        return r116799;
}

double f(double x) {
        double r116800 = x;
        double r116801 = 4.0;
        double r116802 = fma(r116800, r116801, r116800);
        return r116802;
}

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 2020056 +o rules:numerics
(FPCore (x)
  :name "Main:i from "
  :precision binary64
  (+ (+ (+ (+ x x) x) x) x))