\frac{x}{y} \cdot \left(z - t\right) + t\mathsf{fma}\left(\frac{x}{y}, z - t, t\right)double code(double x, double y, double z, double t) {
return (((x / y) * (z - t)) + t);
}
double code(double x, double y, double z, double t) {
return fma((x / y), (z - t), t);
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.1 |
| Herbie | 2.0 |
Initial program 2.0
rmApplied fma-def2.0
Final simplification2.0
herbie shell --seed 2020056 +o rules:numerics
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))
(+ (* (/ x y) (- z t)) t))