x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -2.1628776471159573 \cdot 10^{-32}:\\
\;\;\;\;\frac{y}{a} \cdot \left(z - t\right) + x\\
\mathbf{elif}\;a \le 1.7350666396159628 \cdot 10^{+45}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\sqrt{a}} \cdot \frac{z - t}{\sqrt{a}} + x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r14623284 = x;
double r14623285 = y;
double r14623286 = z;
double r14623287 = t;
double r14623288 = r14623286 - r14623287;
double r14623289 = r14623285 * r14623288;
double r14623290 = a;
double r14623291 = r14623289 / r14623290;
double r14623292 = r14623284 + r14623291;
return r14623292;
}
double f(double x, double y, double z, double t, double a) {
double r14623293 = a;
double r14623294 = -2.1628776471159573e-32;
bool r14623295 = r14623293 <= r14623294;
double r14623296 = y;
double r14623297 = r14623296 / r14623293;
double r14623298 = z;
double r14623299 = t;
double r14623300 = r14623298 - r14623299;
double r14623301 = r14623297 * r14623300;
double r14623302 = x;
double r14623303 = r14623301 + r14623302;
double r14623304 = 1.7350666396159628e+45;
bool r14623305 = r14623293 <= r14623304;
double r14623306 = r14623300 * r14623296;
double r14623307 = r14623306 / r14623293;
double r14623308 = r14623307 + r14623302;
double r14623309 = sqrt(r14623293);
double r14623310 = r14623296 / r14623309;
double r14623311 = r14623300 / r14623309;
double r14623312 = r14623310 * r14623311;
double r14623313 = r14623312 + r14623302;
double r14623314 = r14623305 ? r14623308 : r14623313;
double r14623315 = r14623295 ? r14623303 : r14623314;
return r14623315;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 6.1 |
|---|---|
| Target | 0.6 |
| Herbie | 1.2 |
if a < -2.1628776471159573e-32Initial program 8.7
Simplified1.6
rmApplied fma-udef1.6
if -2.1628776471159573e-32 < a < 1.7350666396159628e+45Initial program 0.8
Simplified3.5
rmApplied fma-udef3.5
rmApplied associate-*r/0.8
if 1.7350666396159628e+45 < a Initial program 10.6
Simplified2.1
rmApplied fma-udef2.1
rmApplied add-sqr-sqrt2.3
Applied *-un-lft-identity2.3
Applied times-frac2.3
Applied associate-*r*1.1
Simplified1.0
Final simplification1.2
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:herbie-target
(if (< y -1.0761266216389975e-10) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))