Average Error: 0.0 → 0
Time: 3.7s
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 r88874 = x;
        double r88875 = r88874 * r88874;
        double r88876 = r88874 + r88875;
        return r88876;
}

double f(double x) {
        double r88877 = x;
        double r88878 = fma(r88877, r88877, r88877);
        return r88878;
}

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