x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;y \le -1.21580676764020581 \cdot 10^{38}:\\
\;\;\;\;\frac{z - t}{\frac{a}{y}} + x\\
\mathbf{elif}\;y \le 2.3757587408965584 \cdot 10^{-14}:\\
\;\;\;\;\left(\frac{z \cdot y}{a} - \frac{t \cdot y}{a}\right) + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r365233 = x;
double r365234 = y;
double r365235 = z;
double r365236 = t;
double r365237 = r365235 - r365236;
double r365238 = r365234 * r365237;
double r365239 = a;
double r365240 = r365238 / r365239;
double r365241 = r365233 + r365240;
return r365241;
}
double f(double x, double y, double z, double t, double a) {
double r365242 = y;
double r365243 = -1.2158067676402058e+38;
bool r365244 = r365242 <= r365243;
double r365245 = z;
double r365246 = t;
double r365247 = r365245 - r365246;
double r365248 = a;
double r365249 = r365248 / r365242;
double r365250 = r365247 / r365249;
double r365251 = x;
double r365252 = r365250 + r365251;
double r365253 = 2.3757587408965584e-14;
bool r365254 = r365242 <= r365253;
double r365255 = r365245 * r365242;
double r365256 = r365255 / r365248;
double r365257 = r365246 * r365242;
double r365258 = r365257 / r365248;
double r365259 = r365256 - r365258;
double r365260 = r365259 + r365251;
double r365261 = r365247 / r365248;
double r365262 = fma(r365242, r365261, r365251);
double r365263 = r365254 ? r365260 : r365262;
double r365264 = r365244 ? r365252 : r365263;
return r365264;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 6.0 |
|---|---|
| Target | 0.6 |
| Herbie | 1.1 |
if y < -1.2158067676402058e+38Initial program 17.3
Simplified4.4
rmApplied fma-udef4.4
Simplified17.3
Taylor expanded around 0 17.3
Simplified4.1
if -1.2158067676402058e+38 < y < 2.3757587408965584e-14Initial program 0.5
Simplified1.7
rmApplied fma-udef1.7
Simplified0.5
Taylor expanded around 0 0.6
Simplified2.0
rmApplied div-sub2.0
Simplified1.4
Simplified0.6
if 2.3757587408965584e-14 < y Initial program 14.4
Simplified3.9
rmApplied fma-udef3.9
Simplified14.4
rmApplied *-un-lft-identity14.4
Applied times-frac0.6
Applied fma-def0.6
Final simplification1.1
herbie shell --seed 2020042 +o rules:numerics
(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 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))