x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \cdot \left(z - t\right) \le -5.46399435477971523 \cdot 10^{251}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{elif}\;y \cdot \left(z - t\right) \le 5.02388448113049226 \cdot 10^{87}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\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 ((((double) (y * ((double) (z - t)))) <= -5.463994354779715e+251)) {
VAR = ((double) (x + ((double) (((double) (y / a)) * ((double) (z - t))))));
} else {
double VAR_1;
if ((((double) (y * ((double) (z - t)))) <= 5.023884481130492e+87)) {
VAR_1 = ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / a))));
} 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.1 |
|---|---|
| Target | 0.8 |
| Herbie | 1.0 |
if (* y (- z t)) < -5.463994354779715e+251Initial program 40.7
rmApplied clear-num40.7
rmApplied associate-/r*0.3
rmApplied div-inv0.3
Applied add-cube-cbrt0.3
Applied times-frac0.4
Simplified0.3
Simplified0.2
if -5.463994354779715e+251 < (* y (- z t)) < 5.023884481130492e+87Initial program 0.5
if 5.023884481130492e+87 < (* y (- z t)) Initial program 15.1
rmApplied *-un-lft-identity15.1
Applied times-frac3.4
Simplified3.4
Final simplification1.0
herbie shell --seed 2020121
(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 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))