x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a} \le -3.4790997908445611 \cdot 10^{282}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a} \le 1.72331315512408106 \cdot 10^{277}:\\
\;\;\;\;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) (((double) (y * ((double) (z - t)))) / a)) <= -3.479099790844561e+282)) {
VAR = ((double) (x + ((double) (((double) (y / a)) * ((double) (z - t))))));
} else {
double VAR_1;
if ((((double) (((double) (y * ((double) (z - t)))) / a)) <= 1.723313155124081e+277)) {
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.0 |
|---|---|
| Target | 0.6 |
| Herbie | 0.8 |
if (/ (* y (- z t)) a) < -3.4790997908445611e282Initial program 49.1
rmApplied associate-/l*7.1
rmApplied associate-/r/2.1
if -3.4790997908445611e282 < (/ (* y (- z t)) a) < 1.72331315512408106e277Initial program 0.3
if 1.72331315512408106e277 < (/ (* y (- z t)) a) Initial program 45.9
rmApplied *-un-lft-identity45.9
Applied times-frac6.6
Simplified6.6
Final simplification0.8
herbie shell --seed 2020147
(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)))