Average Error: 45.7 → 8.7
Time: 17.9s
Precision: 64
Internal Precision: 128
\[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
\[\left((x \cdot y + z)_* - \left(z + x \cdot y\right)\right) - 1\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.7
Target0
Herbie8.7
\[-1\]

Derivation

  1. Initial program 45.7

    \[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
  2. Using strategy rm
  3. Applied +-commutative45.7

    \[\leadsto (x \cdot y + z)_* - \color{blue}{\left(\left(x \cdot y + z\right) + 1\right)}\]
  4. Applied associate--r+8.7

    \[\leadsto \color{blue}{\left((x \cdot y + z)_* - \left(x \cdot y + z\right)\right) - 1}\]
  5. Final simplification8.7

    \[\leadsto \left((x \cdot y + z)_* - \left(z + x \cdot y\right)\right) - 1\]

Reproduce

herbie shell --seed 2019088 
(FPCore (x y z)
  :name "simple fma test"

  :herbie-target
  -1

  (- (fma x y z) (+ 1 (+ (* x y) z))))