x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \cdot \left(z - t\right) \le -1.0472918722525199 \cdot 10^{169}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;y \cdot \left(z - t\right) \le 2.98737410196817466 \cdot 10^{163}:\\
\;\;\;\;x - \frac{1}{\frac{a}{y \cdot \left(z - t\right)}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{a} - \frac{t}{a}\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)))) <= -1.0472918722525199e+169)) {
VAR = ((double) (x - ((double) (y / ((double) (a / ((double) (z - t))))))));
} else {
double VAR_1;
if ((((double) (y * ((double) (z - t)))) <= 2.9873741019681747e+163)) {
VAR_1 = ((double) (x - ((double) (1.0 / ((double) (a / ((double) (y * ((double) (z - t))))))))));
} else {
VAR_1 = ((double) (x - ((double) (y * ((double) (((double) (z / a)) - ((double) (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.1 |
|---|---|
| Target | 0.7 |
| Herbie | 0.7 |
if (* y (- z t)) < -1.0472918722525199e169Initial program 23.9
rmApplied associate-/l*1.3
if -1.0472918722525199e169 < (* y (- z t)) < 2.98737410196817466e163Initial program 0.4
rmApplied clear-num0.5
if 2.98737410196817466e163 < (* y (- z t)) Initial program 22.4
rmApplied add-cube-cbrt22.9
Applied times-frac1.5
Taylor expanded around 0 22.4
Simplified1.7
Final simplification0.7
herbie shell --seed 2020163
(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)))