Average Error: 0.0 → 0
Time: 7.5m
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 r4218086 = x;
        double r4218087 = r4218086 * r4218086;
        double r4218088 = r4218086 + r4218087;
        return r4218088;
}

double f(double x) {
        double r4218089 = x;
        double r4218090 = fma(r4218089, r4218089, r4218089);
        return r4218090;
}

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