Average Error: 0.0 → 0
Time: 11.9s
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 r1743142 = x;
        double r1743143 = r1743142 * r1743142;
        double r1743144 = r1743142 + r1743143;
        return r1743144;
}

double f(double x) {
        double r1743145 = x;
        double r1743146 = fma(r1743145, r1743145, r1743145);
        return r1743146;
}

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