Average Error: 0 → 0
Time: 572.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 r143399 = x;
        double r143400 = r143399 + r143399;
        double r143401 = r143400 + r143399;
        double r143402 = r143401 + r143399;
        double r143403 = r143402 + r143399;
        return r143403;
}

double f(double x) {
        double r143404 = x;
        double r143405 = 4.0;
        double r143406 = fma(r143404, r143405, r143404);
        return r143406;
}

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