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 - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a} \le 3.85712386761330808 \cdot 10^{295}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \left(z - t\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) (a / ((double) (z - t))))))));
} else {
double VAR_1;
if ((((double) (((double) (y * ((double) (z - t)))) / a)) <= 3.857123867613308e+295)) {
VAR_1 = ((double) (x - ((double) (((double) (y * ((double) (z - t)))) / a))));
} else {
VAR_1 = ((double) (x - ((double) (((double) (z - t)) * ((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.4 |
if (/ (* y (- z t)) a) < -inf.0Initial program 64.0
rmApplied associate-/l*0.2
if -inf.0 < (/ (* y (- z t)) a) < 3.85712386761330808e295Initial program 0.3
if 3.85712386761330808e295 < (/ (* y (- z t)) a) Initial program 55.6
rmApplied add-cube-cbrt55.7
Applied associate-/r*55.7
Simplified16.4
Taylor expanded around 0 55.6
Simplified2.3
Final simplification0.4
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)))