x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \cdot \left(z - t\right) \le -2.177428015600791 \cdot 10^{-29} \lor \neg \left(y \cdot \left(z - t\right) \le 2.80096638894452764 \cdot 10^{52}\right):\\
\;\;\;\;x + \frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{a}{y \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.177428015600791e-29) || !(((double) (y * ((double) (z - t)))) <= 2.8009663889445276e+52))) {
VAR = ((double) (x + ((double) (((double) (y / a)) * ((double) (z - t))))));
} else {
VAR = ((double) (x + ((double) (1.0 / ((double) (a / ((double) (y * ((double) (z - t))))))))));
}
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.8 |
| Herbie | 1.7 |
if (* y (- z t)) < -2.177428015600791e-29 or 2.80096638894452764e52 < (* y (- z t)) Initial program 11.2
rmApplied associate-/l*6.0
rmApplied associate-/r/2.6
if -2.177428015600791e-29 < (* y (- z t)) < 2.80096638894452764e52Initial program 0.7
rmApplied clear-num0.7
Final simplification1.7
herbie shell --seed 2020174
(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)))