Average Error: 0 → 0
Time: 586.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 r111095 = x;
        double r111096 = r111095 + r111095;
        double r111097 = r111096 + r111095;
        double r111098 = r111097 + r111095;
        double r111099 = r111098 + r111095;
        return r111099;
}

double f(double x) {
        double r111100 = x;
        double r111101 = 4.0;
        double r111102 = fma(r111100, r111101, r111100);
        return r111102;
}

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