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

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 45.5

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

    \[\leadsto (x \cdot y + z)_* - \color{blue}{\log \left(e^{1 + \left(x \cdot y + z\right)}\right)}\]
  4. Applied add-log-exp47.8

    \[\leadsto \color{blue}{\log \left(e^{(x \cdot y + z)_*}\right)} - \log \left(e^{1 + \left(x \cdot y + z\right)}\right)\]
  5. Applied diff-log47.8

    \[\leadsto \color{blue}{\log \left(\frac{e^{(x \cdot y + z)_*}}{e^{1 + \left(x \cdot y + z\right)}}\right)}\]
  6. Simplified31.2

    \[\leadsto \log \color{blue}{\left(e^{\left(-1 - x \cdot y\right) + \left((x \cdot y + z)_* - z\right)}\right)}\]
  7. Using strategy rm
  8. Applied associate-+l-15.3

    \[\leadsto \log \left(e^{\color{blue}{-1 - \left(x \cdot y - \left((x \cdot y + z)_* - z\right)\right)}}\right)\]
  9. Applied exp-diff15.3

    \[\leadsto \log \color{blue}{\left(\frac{e^{-1}}{e^{x \cdot y - \left((x \cdot y + z)_* - z\right)}}\right)}\]
  10. Applied log-div15.3

    \[\leadsto \color{blue}{\log \left(e^{-1}\right) - \log \left(e^{x \cdot y - \left((x \cdot y + z)_* - z\right)}\right)}\]
  11. Simplified15.3

    \[\leadsto \color{blue}{-1} - \log \left(e^{x \cdot y - \left((x \cdot y + z)_* - z\right)}\right)\]
  12. Taylor expanded around inf 8.7

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

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

Reproduce

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

  :herbie-target
  -1

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