x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -1.87172369309144556 \cdot 10^{-41}:\\
\;\;\;\;x - y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;a \le 2.78863505349972985 \cdot 10^{-148}:\\
\;\;\;\;x - \frac{1}{\frac{a}{y \cdot \left(z - t\right)}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{a} \cdot \left(z - t\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x - ((double) (((double) (y * ((double) (z - t)))) / a))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((a <= -1.8717236930914456e-41)) {
VAR = ((double) (x - ((double) (y * ((double) (((double) (z - t)) / a))))));
} else {
double VAR_1;
if ((a <= 2.78863505349973e-148)) {
VAR_1 = ((double) (x - ((double) (1.0 / ((double) (a / ((double) (y * ((double) (z - t))))))))));
} else {
VAR_1 = ((double) (x - ((double) (((double) (y / a)) * ((double) (z - t))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 5.9 |
|---|---|
| Target | 0.6 |
| Herbie | 1.3 |
if a < -1.8717236930914456e-41Initial program 8.4
rmApplied *-un-lft-identity8.4
Applied times-frac0.8
Simplified0.8
if -1.8717236930914456e-41 < a < 2.78863505349973e-148Initial program 0.8
rmApplied clear-num0.8
if 2.78863505349973e-148 < a Initial program 6.8
rmApplied associate-/l*2.4
rmApplied associate-/r/1.9
Final simplification1.3
herbie shell --seed 2020129
(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.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))
(- x (/ (* y (- z t)) a)))