x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \le -4.2135686961967969 \cdot 10^{-50}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;y \le 9.6554469454378984 \cdot 10^{-14}:\\
\;\;\;\;x - \frac{1}{\frac{a}{y \cdot \left(z - t\right)}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z - t}{a}\\
\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 ((y <= -4.213568696196797e-50)) {
VAR = ((double) (x - ((double) (y / ((double) (a / ((double) (z - t))))))));
} else {
double VAR_1;
if ((y <= 9.655446945437898e-14)) {
VAR_1 = ((double) (x - ((double) (1.0 / ((double) (a / ((double) (y * ((double) (z - t))))))))));
} else {
VAR_1 = ((double) (x - ((double) (y * ((double) (((double) (z - t)) / a))))));
}
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 | 6.2 |
|---|---|
| Target | 0.7 |
| Herbie | 0.8 |
if y < -4.2135686961967969e-50Initial program 12.3
rmApplied associate-/l*0.9
if -4.2135686961967969e-50 < y < 9.6554469454378984e-14Initial program 0.6
rmApplied clear-num0.7
if 9.6554469454378984e-14 < y Initial program 14.7
rmApplied *-un-lft-identity14.7
Applied times-frac0.8
Simplified0.8
Final simplification0.8
herbie shell --seed 2020155
(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)))