x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \cdot \left(z - t\right) \leq -3.144686656547863 \cdot 10^{+132}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;y \cdot \left(z - t\right) \leq 6.976797937108467 \cdot 10^{+210}:\\
\;\;\;\;x + \frac{-1}{\frac{a}{y \cdot \left(z - t\right)}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\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)) -3.144686656547863e+132)
(- x (/ y (/ a (- z t))))
(if (<= (* y (- z t)) 6.976797937108467e+210)
(+ x (/ -1.0 (/ a (* y (- z t)))))
(+ x (* (/ y a) (- t z))))))double code(double x, double y, double z, double t, double a) {
return ((double) (x - (((double) (y * ((double) (z - t)))) / a)));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((((double) (y * ((double) (z - t)))) <= -3.144686656547863e+132)) {
tmp = ((double) (x - (y / (a / ((double) (z - t))))));
} else {
double tmp_1;
if ((((double) (y * ((double) (z - t)))) <= 6.976797937108467e+210)) {
tmp_1 = ((double) (x + (-1.0 / (a / ((double) (y * ((double) (z - t))))))));
} else {
tmp_1 = ((double) (x + ((double) ((y / a) * ((double) (t - z))))));
}
tmp = tmp_1;
}
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.8 |
|---|---|
| Target | 0.6 |
| Herbie | 0.7 |
if (* y (- z t)) < -3.14468665654786308e132Initial program Error: 18.7 bits
rmApplied associate-/l*Error: 1.7 bits
if -3.14468665654786308e132 < (* y (- z t)) < 6.9767979371084669e210Initial program Error: 0.4 bits
rmApplied clear-numError: 0.4 bits
if 6.9767979371084669e210 < (* y (- z t)) Initial program Error: 29.9 bits
rmApplied sub-negError: 29.9 bits
SimplifiedError: 0.7 bits
Final simplificationError: 0.7 bits
herbie shell --seed 2020203
(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)))