Average Error: 0.0 → 0
Time: 595.0ms
Precision: 64
\[x + x \cdot x\]
\[\mathsf{fma}\left(x, x, x\right)\]
x + x \cdot x
\mathsf{fma}\left(x, x, x\right)
double f(double x) {
        double r112036 = x;
        double r112037 = r112036 * r112036;
        double r112038 = r112036 + r112037;
        return r112038;
}

double f(double x) {
        double r112039 = x;
        double r112040 = fma(r112039, r112039, r112039);
        return r112040;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[x + x \cdot x\]
  2. Simplified0

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

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

Reproduce

herbie shell --seed 2019325 +o rules:numerics
(FPCore (x)
  :name "Main:bigenough1 from B"
  :precision binary64
  (+ x (* x x)))