Average Error: 0.0 → 0
Time: 1.1s
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 r5461427 = x;
        double r5461428 = r5461427 * r5461427;
        double r5461429 = r5461427 + r5461428;
        return r5461429;
}

double f(double x) {
        double r5461430 = x;
        double r5461431 = fma(r5461430, r5461430, r5461430);
        return r5461431;
}

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