Average Error: 0.0 → 0
Time: 4.4s
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 r3395796 = x;
        double r3395797 = r3395796 * r3395796;
        double r3395798 = r3395796 + r3395797;
        return r3395798;
}

double f(double x) {
        double r3395799 = x;
        double r3395800 = fma(r3395799, r3395799, r3395799);
        return r3395800;
}

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