Average Error: 0.0 → 0
Time: 452.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 r120062 = x;
        double r120063 = r120062 * r120062;
        double r120064 = r120062 + r120063;
        return r120064;
}

double f(double x) {
        double r120065 = x;
        double r120066 = fma(r120065, r120065, r120065);
        return r120066;
}

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