Average Error: 44.6 → 8.1
Time: 21.1s
Precision: 64
Internal Precision: 128
\[(x \cdot y + z)_* - \left(1 + \left(x \cdot y + z\right)\right)\]
\[\log \left(e^{-1 - \left(\left(z + x \cdot y\right) - (x \cdot y + z)_*\right)}\right)\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original44.6
Target0
Herbie8.1
\[-1\]

Derivation

  1. Initial program 44.6

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

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

    \[\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-log46.9

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

    \[\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-14.9

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

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

    \[\leadsto \log \left(e^{-1 - \left(\left(z + x \cdot y\right) - (x \cdot y + z)_*\right)}\right)\]

Reproduce

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

  :herbie-target
  -1

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