x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \cdot \left(z - t\right) \le -2.8902720897188176 \cdot 10^{172}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;y \cdot \left(z - t\right) \le 3.40022202014980057 \cdot 10^{203}:\\
\;\;\;\;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 ((((double) (y * ((double) (z - t)))) <= -2.8902720897188176e+172)) {
VAR = ((double) (x + ((double) (y * ((double) (((double) (z - t)) / a))))));
} else {
double VAR_1;
if ((((double) (y * ((double) (z - t)))) <= 3.4002220201498006e+203)) {
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 | 6.2 |
|---|---|
| Target | 0.6 |
| Herbie | 0.6 |
if (* y (- z t)) < -2.8902720897188176e172Initial program 22.4
rmApplied *-un-lft-identity22.4
Applied times-frac1.4
Simplified1.4
if -2.8902720897188176e172 < (* y (- z t)) < 3.40022202014980057e203Initial program 0.4
rmApplied clear-num0.5
if 3.40022202014980057e203 < (* y (- z t)) Initial program 30.8
rmApplied associate-/l*0.9
rmApplied associate-/r/0.8
Final simplification0.6
herbie shell --seed 2020153
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
: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)))