Average Error: 45.0 → 44.2
Time: 3.4s
Precision: binary64
\[\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\]
\[\langle \left( \langle \left( \mathsf{fma}\left(x, y, z\right) - \left(1 + \left(\sqrt[3]{z + x \cdot y} \cdot \sqrt[3]{z + x \cdot y}\right) \cdot \left(\sqrt[3]{\sqrt[3]{z + x \cdot y}} \cdot \left(\sqrt[3]{\sqrt[3]{z + x \cdot y}} \cdot \sqrt[3]{\sqrt[3]{z + x \cdot y}}\right)\right)\right) \right)_{binary64} \rangle_{posit16} \right)_{posit16} \rangle_{binary64}\]
\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)
\langle \left( \langle \left( \mathsf{fma}\left(x, y, z\right) - \left(1 + \left(\sqrt[3]{z + x \cdot y} \cdot \sqrt[3]{z + x \cdot y}\right) \cdot \left(\sqrt[3]{\sqrt[3]{z + x \cdot y}} \cdot \left(\sqrt[3]{\sqrt[3]{z + x \cdot y}} \cdot \sqrt[3]{\sqrt[3]{z + x \cdot y}}\right)\right)\right) \right)_{binary64} \rangle_{posit16} \right)_{posit16} \rangle_{binary64}
(FPCore (x y z) :precision binary64 (- (fma x y z) (+ 1.0 (+ (* x y) z))))
(FPCore (x y z)
 :precision binary64
 (cast
  (!
   :precision
   posit16
   (cast
    (!
     :precision
     binary64
     (-
      (fma x y z)
      (+
       1.0
       (*
        (* (cbrt (+ z (* x y))) (cbrt (+ z (* x y))))
        (*
         (cbrt (cbrt (+ z (* x y))))
         (* (cbrt (cbrt (+ z (* x y)))) (cbrt (cbrt (+ z (* x y))))))))))))))

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original45.0
Target0
Herbie44.2
\[-1\]

Derivation

  1. Initial program 45.0

    \[\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\]
  2. Using strategy rm
  3. Applied insert-posit1644.9

    \[\leadsto \color{blue}{\langle \color{blue}{\left( \color{blue}{\langle \color{blue}{\left( \color{blue}{\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)} \right)_{binary64}} \rangle_{posit16}} \right)_{posit16}} \rangle_{binary64}}\]
  4. Simplified44.9

    \[\leadsto \langle \left( \langle \left( \color{blue}{\mathsf{fma}\left(x, y, z\right)} - \left(1 + \left(z + x \cdot y\right)\right) \right)_{binary64} \rangle_{posit16} \right)_{posit16} \rangle_{binary64}\]
  5. Using strategy rm
  6. Applied add-cube-cbrt_binary6444.2

    \[\leadsto \langle \left( \langle \left( \mathsf{fma}\left(x, y, z\right) - \left(1 + \left(\sqrt[3]{z + x \cdot y} \cdot \sqrt[3]{z + x \cdot y}\right) \cdot \sqrt[3]{z + x \cdot y}\right) \right)_{binary64} \rangle_{posit16} \right)_{posit16} \rangle_{binary64}\]
  7. Using strategy rm
  8. Applied add-cube-cbrt_binary6444.2

    \[\leadsto \langle \left( \langle \left( \mathsf{fma}\left(x, y, z\right) - \left(1 + \left(\sqrt[3]{z + x \cdot y} \cdot \sqrt[3]{z + x \cdot y}\right) \cdot \left(\left(\sqrt[3]{\sqrt[3]{z + x \cdot y}} \cdot \sqrt[3]{\sqrt[3]{z + x \cdot y}}\right) \cdot \sqrt[3]{\sqrt[3]{z + x \cdot y}}\right)\right) \right)_{binary64} \rangle_{posit16} \right)_{posit16} \rangle_{binary64}\]
  9. Final simplification44.2

    \[\leadsto \langle \left( \langle \left( \mathsf{fma}\left(x, y, z\right) - \left(1 + \left(\sqrt[3]{z + x \cdot y} \cdot \sqrt[3]{z + x \cdot y}\right) \cdot \left(\sqrt[3]{\sqrt[3]{z + x \cdot y}} \cdot \left(\sqrt[3]{\sqrt[3]{z + x \cdot y}} \cdot \sqrt[3]{\sqrt[3]{z + x \cdot y}}\right)\right)\right) \right)_{binary64} \rangle_{posit16} \right)_{posit16} \rangle_{binary64}\]

Reproduce

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

  :herbie-target
  -1.0

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