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

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.2
Target0
Herbie7.9
\[-1\]

Derivation

  1. Initial program 45.2

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

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

    \[\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.5

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

    \[\leadsto \log \color{blue}{\left(\frac{e^{(x \cdot y + z)_* - \left(z + x \cdot y\right)}}{e}\right)}\]
  7. Final simplification7.9

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

Reproduce

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

  :herbie-target
  -1

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