x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a} = -inf.0:\\
\;\;\;\;x + y \cdot \frac{1}{\frac{a}{t - z}}\\
\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a} \le 5.72597468503871405 \cdot 10^{222}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(t - z\right) \cdot \frac{y}{a}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x - ((double) (((double) (y * ((double) (z - t)))) / a))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((((double) (((double) (y * ((double) (z - t)))) / a)) <= -inf.0)) {
VAR = ((double) (x + ((double) (y * ((double) (1.0 / ((double) (a / ((double) (t - z))))))))));
} else {
double VAR_1;
if ((((double) (((double) (y * ((double) (z - t)))) / a)) <= 5.725974685038714e+222)) {
VAR_1 = ((double) (x - ((double) (((double) (y * ((double) (z - t)))) / a))));
} else {
VAR_1 = ((double) (x + ((double) (((double) (t - z)) * ((double) (y / a))))));
}
VAR = VAR_1;
}
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.0 |
|---|---|
| Target | 0.6 |
| Herbie | 0.6 |
if (/ (* y (- z t)) a) < -inf.0Initial program 64.0
Simplified0.2
rmApplied clear-num0.3
if -inf.0 < (/ (* y (- z t)) a) < 5.72597468503871405e222Initial program 0.3
if 5.72597468503871405e222 < (/ (* y (- z t)) a) Initial program 31.6
Simplified12.7
rmApplied clear-num12.7
rmApplied associate-/r/12.7
Applied associate-*r*4.1
Simplified4.0
Final simplification0.6
herbie shell --seed 2020179
(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)))