x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \cdot \left(z - t\right) \le -1.6326385093152292 \cdot 10^{284} \lor \neg \left(y \cdot \left(z - t\right) \le 7.14285184082454088 \cdot 10^{130}\right):\\
\;\;\;\;x + \left(z \cdot \frac{y}{a} + \frac{y}{a} \cdot \left(-t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\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 ((((y * (z - t)) <= -1.6326385093152292e+284) || !((y * (z - t)) <= 7.142851840824541e+130))) {
temp = (x + ((z * (y / a)) + ((y / a) * -t)));
} else {
temp = (x + ((y * (z - t)) / a));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 5.9 |
|---|---|
| Target | 0.8 |
| Herbie | 0.6 |
if (* y (- z t)) < -1.6326385093152292e+284 or 7.142851840824541e+130 < (* y (- z t)) Initial program 27.6
rmApplied associate-/l*1.9
rmApplied associate-/r/1.3
rmApplied sub-neg1.3
Applied distribute-lft-in1.3
Simplified1.3
if -1.6326385093152292e+284 < (* y (- z t)) < 7.142851840824541e+130Initial program 0.4
Final simplification0.6
herbie shell --seed 2020057
(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)))