x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \leq -4.210519492156666 \cdot 10^{-109} \lor \neg \left(a \leq 9.098611020860329 \cdot 10^{-104}\right):\\
\;\;\;\;x + y \cdot \left(\frac{t}{a} - \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \left(t - z\right)\right) \cdot \frac{1}{a}\\
\end{array}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 VAR;
if (((a <= -4.210519492156666e-109) || !(a <= 9.098611020860329e-104))) {
VAR = ((double) (x + ((double) (y * ((double) ((t / a) - (z / a)))))));
} else {
VAR = ((double) (x + ((double) (((double) (y * ((double) (t - z)))) * (1.0 / a)))));
}
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.5 |
|---|---|
| Target | 0.8 |
| Herbie | 1.7 |
if a < -4.2105194921566659e-109 or 9.0986110208603289e-104 < a Initial program 7.9
Simplified1.7
rmApplied div-sub1.7
if -4.2105194921566659e-109 < a < 9.0986110208603289e-104Initial program 1.6
Simplified21.1
rmApplied div-inv21.1
Applied associate-*r*1.6
Final simplification1.7
herbie shell --seed 2020196
(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)))