x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \cdot \left(z - t\right) \leq -7.329837396606733 \cdot 10^{+256}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;y \cdot \left(z - t\right) \leq 5.351143384782188 \cdot 10^{+233}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \left(z - t\right) \cdot \frac{y}{a}\\
\end{array}(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
(FPCore (x y z t a)
:precision binary64
(if (<= (* y (- z t)) -7.329837396606733e+256)
(- x (/ y (/ a (- z t))))
(if (<= (* y (- z t)) 5.351143384782188e+233)
(- x (/ (* y (- z t)) a))
(- x (* (- z t) (/ y a))))))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 tmp;
if ((y * (z - t)) <= -7.329837396606733e+256) {
tmp = x - (y / (a / (z - t)));
} else if ((y * (z - t)) <= 5.351143384782188e+233) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - ((z - t) * (y / a));
}
return tmp;
}




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.4 |
if (*.f64 y (-.f64 z t)) < -7.3298373966067332e256Initial program 41.8
rmApplied associate-/l*_binary64_105940.2
if -7.3298373966067332e256 < (*.f64 y (-.f64 z t)) < 5.3511433847821882e233Initial program 0.4
if 5.3511433847821882e233 < (*.f64 y (-.f64 z t)) Initial program 33.4
rmApplied add-cube-cbrt_binary64_1068433.8
Applied associate-/r*_binary64_1059333.8
Simplified8.4
rmApplied *-un-lft-identity_binary64_106498.4
Applied times-frac_binary64_106551.0
Simplified1.0
Simplified0.2
Final simplification0.4
herbie shell --seed 2020355
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
: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)))