Average Error: 38.4 → 0.0
Time: 1.6m
Precision: 64
Internal Precision: 128
\[\left(x + 1\right) \cdot \left(x + 1\right) - 1\]
\[\left(x + 2\right) \cdot x\]

Error

Bits error versus x

Derivation

  1. Initial program 38.4

    \[\left(x + 1\right) \cdot \left(x + 1\right) - 1\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\left(2 + x\right) \cdot x}\]
  3. Final simplification0.0

    \[\leadsto \left(x + 2\right) \cdot x\]

Reproduce

herbie shell --seed 2019088 +o rules:numerics
(FPCore (x)
  :name "Expanding a square"
  (- (* (+ x 1) (+ x 1)) 1))