Average Error: 0.0 → 0
Time: 2.3m
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 r6287112 = x;
        double r6287113 = r6287112 * r6287112;
        double r6287114 = r6287112 + r6287113;
        return r6287114;
}

double f(double x) {
        double r6287115 = x;
        double r6287116 = fma(r6287115, r6287115, r6287115);
        return r6287116;
}

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 2019163 +o rules:numerics
(FPCore (x)
  :name "Main:bigenough1 from B"
  (+ x (* x x)))