x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \cdot \left(z - t\right) \leq 6.239880001616539 \cdot 10^{-112}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{elif}\;y \cdot \left(z - t\right) \leq 4.716240774094716 \cdot 10^{+282}:\\
\;\;\;\;x - \frac{y \cdot z - y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\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)) 6.239880001616539e-112)
(+ x (* (/ y a) (- t z)))
(if (<= (* y (- z t)) 4.716240774094716e+282)
(- x (/ (- (* y z) (* y t)) a))
(- x (/ y (/ a (- z t)))))))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)))) <= 6.239880001616539e-112)) {
tmp = ((double) (x + ((double) ((y / a) * ((double) (t - z))))));
} else {
double tmp_1;
if ((((double) (y * ((double) (z - t)))) <= 4.716240774094716e+282)) {
tmp_1 = ((double) (x - (((double) (((double) (y * z)) - ((double) (y * t)))) / a)));
} else {
tmp_1 = ((double) (x - (y / (a / ((double) (z - t))))));
}
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 | 6.2 |
|---|---|
| Target | 0.7 |
| Herbie | 1.4 |
if (*.f64 y (-.f64 z t)) < 6.2398800016165392e-112Initial program 4.9
rmApplied sub-neg_binary644.9
Simplified2.1
if 6.2398800016165392e-112 < (*.f64 y (-.f64 z t)) < 4.7162407740947161e282Initial program 0.1
rmApplied sub-neg_binary640.1
Applied distribute-lft-in_binary640.1
if 4.7162407740947161e282 < (*.f64 y (-.f64 z t)) Initial program 51.9
rmApplied associate-/l*_binary640.2
Final simplification1.4
herbie shell --seed 2020205
(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)))