\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;t \le -2.12798841357713354 \cdot 10^{-231} \lor \neg \left(t \le 5.2724662238813797 \cdot 10^{-136}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y}, z - t, t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\end{array}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) {
double VAR;
if (((t <= -2.1279884135771335e-231) || !(t <= 5.27246622388138e-136))) {
VAR = fma((x / y), (z - t), t);
} else {
VAR = ((x * ((z - t) / y)) + t);
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.2 |
| Herbie | 2.1 |
if t < -2.1279884135771335e-231 or 5.27246622388138e-136 < t Initial program 1.2
Simplified1.2
if -2.1279884135771335e-231 < t < 5.27246622388138e-136Initial program 4.8
rmApplied div-inv4.9
Applied associate-*l*5.4
Simplified5.3
Final simplification2.1
herbie shell --seed 2020092 +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))