x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \le -1.39267331937567577 \cdot 10^{-17} \lor \neg \left(y \le 4.7790321465538917 \cdot 10^{-95}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{1}{\frac{a}{y \cdot \left(z - t\right)}}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x - ((y * (z - t)) / a));
}
double code(double x, double y, double z, double t, double a) {
double temp;
if (((y <= -1.3926733193756758e-17) || !(y <= 4.779032146553892e-95))) {
temp = (x - (y / (a / (z - t))));
} else {
temp = (x - (1.0 / (a / (y * (z - t)))));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 6.1 |
|---|---|
| Target | 0.7 |
| Herbie | 1.0 |
if y < -1.3926733193756758e-17 or 4.779032146553892e-95 < y Initial program 12.0
rmApplied associate-/l*1.3
if -1.3926733193756758e-17 < y < 4.779032146553892e-95Initial program 0.7
rmApplied clear-num0.7
Final simplification1.0
herbie shell --seed 2020066 +o rules:numerics
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:herbie-target
(if (< y -1.0761266216389975e-10) (- x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))
(- x (/ (* y (- z t)) a)))