Average Error: 0.0 → 0
Time: 601.0ms
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 r106378 = x;
        double r106379 = r106378 * r106378;
        double r106380 = r106378 + r106379;
        return r106380;
}

double f(double x) {
        double r106381 = x;
        double r106382 = fma(r106381, r106381, r106381);
        return r106382;
}

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