\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)\begin{array}{l}
\mathbf{if}\;x \leq -0.5750703147639804 \lor \neg \left(x \leq 1.7079677124514205\right):\\
\;\;\;\;\left(\mathsf{fma}\left(0, 0, 0\right) - 1\right) \cdot \langle \left( \langle \left( \left(1 - \frac{1}{x}\right) \right)_{binary64} \rangle_{posit16} \right)_{posit16} \rangle_{binary64}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(0, 0, 0\right) - 1\right) \cdot \left(x + 1\right)\\
\end{array}(FPCore (x y z) :precision binary64 (- (fma x y z) (+ 1.0 (+ (* x y) z))))
(FPCore (x y z)
:precision binary64
(if (or (<= x -0.5750703147639804) (not (<= x 1.7079677124514205)))
(*
(- (fma 0.0 0.0 0.0) 1.0)
(cast
(! :precision posit16 (cast (! :precision binary64 (- 1.0 (/ 1.0 x)))))))
(* (- (fma 0.0 0.0 0.0) 1.0) (+ x 1.0))))



Bits error versus x




Bits error versus y




Bits error versus z
| Original | 45.0 |
|---|---|
| Target | 0 |
| Herbie | 0.9 |
if x < -0.5750703147639804 or 1.707967712451421 < x Initial program 53.4
Taylor expanded around -inf 1.3
rmApplied insert-posit160.6
if -0.5750703147639804 < x < 1.707967712451421Initial program 36.7
Taylor expanded around 0 1.3
Simplified1.3
Final simplification0.9
herbie shell --seed 2020268
(FPCore (x y z)
:name "simple fma test"
:precision binary64
:herbie-target
-1.0
(- (fma x y z) (+ 1.0 (+ (* x y) z))))