x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \leq -1.5168454939763745 \cdot 10^{+56}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;a \leq 1.8486538021209086 \cdot 10^{+59}:\\
\;\;\;\;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 (<= a -1.5168454939763745e+56)
(+ x (* y (/ (- z t) a)))
(if (<= a 1.8486538021209086e+59)
(+ x (/ (- (* y z) (* y t)) a))
(+ x (/ y (/ a (- z t)))))))double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.5168454939763745e+56) {
tmp = x + (y * ((z - t) / a));
} else if (a <= 1.8486538021209086e+59) {
tmp = x + (((y * z) - (y * t)) / a);
} else {
tmp = x + (y / (a / (z - t)));
}
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.9 |
|---|---|
| Target | 0.7 |
| Herbie | 0.9 |
if a < -1.51684549397637448e56Initial program 10.3
rmApplied *-un-lft-identity_binary64_928510.3
Applied times-frac_binary64_92910.6
Simplified0.6
if -1.51684549397637448e56 < a < 1.84865380212090857e59Initial program 1.1
rmApplied sub-neg_binary64_92781.1
Applied distribute-rgt-in_binary64_92351.1
Simplified1.1
Simplified1.1
if 1.84865380212090857e59 < a Initial program 10.4
rmApplied associate-/l*_binary64_92300.8
Final simplification0.9
herbie shell --seed 2020342
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
: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)))