Average Error: 0.0 → 0
Time: 587.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 r74287 = x;
        double r74288 = r74287 * r74287;
        double r74289 = r74287 + r74288;
        return r74289;
}

double f(double x) {
        double r74290 = x;
        double r74291 = fma(r74290, r74290, r74290);
        return r74291;
}

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