x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \cdot \left(z - t\right) \le -1.37784695377484635 \cdot 10^{240}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;y \cdot \left(z - t\right) \le 9.00014865074114473 \cdot 10^{239}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a}\\
\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)))) <= -1.3778469537748463e+240)) {
VAR = ((double) (x + ((double) (y * ((double) (((double) (z - t)) / a))))));
} else {
double VAR_1;
if ((((double) (y * ((double) (z - t)))) <= 9.000148650741145e+239)) {
VAR_1 = ((double) (x + ((double) (((double) (y * ((double) (z - t)))) * ((double) (1.0 / a))))));
} 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.0 |
|---|---|
| Target | 0.7 |
| Herbie | 0.4 |
if (* y (- z t)) < -1.3778469537748463e+240Initial program 38.2
rmApplied *-un-lft-identity38.2
Applied times-frac0.3
Simplified0.3
if -1.3778469537748463e+240 < (* y (- z t)) < 9.000148650741145e+239Initial program 0.4
rmApplied div-inv0.4
if 9.000148650741145e+239 < (* y (- z t)) Initial program 37.0
rmApplied associate-/l*0.5
rmApplied associate-/r/0.5
Final simplification0.4
herbie shell --seed 2020128
(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)))