Average Error: 0.0 → 0
Time: 3.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 r5676182 = x;
        double r5676183 = r5676182 * r5676182;
        double r5676184 = r5676182 + r5676183;
        return r5676184;
}

double f(double x) {
        double r5676185 = x;
        double r5676186 = fma(r5676185, r5676185, r5676185);
        return r5676186;
}

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