x + \frac{y \cdot \left(z - t\right)}{a}
\begin{array}{l}
\mathbf{if}\;y \leq -7.468413263144839 \cdot 10^{-53}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;y \leq 4.871718399021154 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\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 -7.468413263144839e-53)
(+ x (/ y (/ a (- z t))))
(if (<= y 4.871718399021154e-8)
(+ x (/ (* y (- z t)) a))
(fma y (/ (- z t) a) x))))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 (y <= -7.468413263144839e-53) {
tmp = x + (y / (a / (z - t)));
} else if (y <= 4.871718399021154e-8) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = fma(y, ((z - t) / a), x);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 5.9 |
|---|---|
| Target | 0.7 |
| Herbie | 0.7 |
if y < -7.46841326314483858e-53Initial program 12.3
Applied associate-/l*_binary641.0
if -7.46841326314483858e-53 < y < 4.87171839902115395e-8Initial program 0.5
if 4.87171839902115395e-8 < y Initial program 14.6
Simplified0.8
Final simplification0.7
herbie shell --seed 2021313
(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)))