Average Error: 0.0 → 0
Time: 5.8s
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 r93900 = x;
        double r93901 = r93900 * r93900;
        double r93902 = r93900 + r93901;
        return r93902;
}

double f(double x) {
        double r93903 = x;
        double r93904 = fma(r93903, r93903, r93903);
        return r93904;
}

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