Average Error: 0 → 0
Time: 612.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 r112830 = x;
        double r112831 = r112830 + r112830;
        double r112832 = r112831 + r112830;
        double r112833 = r112832 + r112830;
        double r112834 = r112833 + r112830;
        return r112834;
}

double f(double x) {
        double r112835 = x;
        double r112836 = 4.0;
        double r112837 = fma(r112835, r112836, r112835);
        return r112837;
}

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