x + \frac{y \cdot \left(z - x\right)}{t}\begin{array}{l}
\mathbf{if}\;x \le 1.45494683705326644 \cdot 10^{-300} \lor \neg \left(x \le 5.69376695784929436 \cdot 10^{-84}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - x}{t} + x\\
\end{array}double code(double x, double y, double z, double t) {
return (x + ((y * (z - x)) / t));
}
double code(double x, double y, double z, double t) {
double temp;
if (((x <= 1.4549468370532664e-300) || !(x <= 5.693766957849294e-84))) {
temp = fma((y / t), (z - x), x);
} else {
temp = ((y * ((z - x) / t)) + x);
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.7 |
|---|---|
| Target | 2.0 |
| Herbie | 2.1 |
if x < 1.4549468370532664e-300 or 5.693766957849294e-84 < x Initial program 7.0
Simplified1.5
if 1.4549468370532664e-300 < x < 5.693766957849294e-84Initial program 5.5
Simplified4.3
rmApplied fma-udef4.3
rmApplied div-inv4.4
Applied associate-*l*4.7
Simplified4.6
Final simplification2.1
herbie shell --seed 2020056 +o rules:numerics
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))