Average Error: 0.0 → 0
Time: 3.8m
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 r6400995 = x;
        double r6400996 = r6400995 * r6400995;
        double r6400997 = r6400995 + r6400996;
        return r6400997;
}

double f(double x) {
        double r6400998 = x;
        double r6400999 = fma(r6400998, r6400998, r6400998);
        return r6400999;
}

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