Average Error: 44.8 → 8.1
Time: 33.7s
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

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

Derivation

  1. Initial program 44.8

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

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

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

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

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

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

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

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

    \[\leadsto \log \color{blue}{\left(\frac{e^{\left((x \cdot y + z)_* - x \cdot y\right) - z}}{e}\right)}\]
  11. Using strategy rm
  12. Applied log-div13.1

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

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

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

Reproduce

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

  :herbie-target
  -1

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