x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -7.9936955577655023 \cdot 10^{-36}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;a \le 9.83225554937983249 \cdot 10^{-19}:\\
\;\;\;\;x + \frac{1}{\frac{a}{y \cdot \left(z - t\right)}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot 1}{\frac{a}{z - t}}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + ((y * (z - t)) / a));
}
double code(double x, double y, double z, double t, double a) {
double temp;
if ((a <= -7.993695557765502e-36)) {
temp = (x + (y * ((z - t) / a)));
} else {
double temp_1;
if ((a <= 9.832255549379832e-19)) {
temp_1 = (x + (1.0 / (a / (y * (z - t)))));
} else {
temp_1 = (x + ((y * 1.0) / (a / (z - t))));
}
temp = temp_1;
}
return temp;
}




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.8 |
if a < -7.993695557765502e-36Initial program 8.6
rmApplied *-un-lft-identity8.6
Applied times-frac0.7
Simplified0.7
if -7.993695557765502e-36 < a < 9.832255549379832e-19Initial program 1.0
rmApplied clear-num1.1
if 9.832255549379832e-19 < a Initial program 8.8
rmApplied *-un-lft-identity8.8
Applied associate-*r*8.8
Applied associate-/l*0.5
Final simplification0.8
herbie shell --seed 2020066 +o rules:numerics
(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)))