x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -1.39950285805274381 \cdot 10^{104}:\\
\;\;\;\;\frac{y}{\frac{a}{z - t}} + x\\
\mathbf{elif}\;a \le 3.75740059193433464 \cdot 10^{65}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{a} + 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 r325000 = x;
double r325001 = y;
double r325002 = z;
double r325003 = t;
double r325004 = r325002 - r325003;
double r325005 = r325001 * r325004;
double r325006 = a;
double r325007 = r325005 / r325006;
double r325008 = r325000 + r325007;
return r325008;
}
double f(double x, double y, double z, double t, double a) {
double r325009 = a;
double r325010 = -1.3995028580527438e+104;
bool r325011 = r325009 <= r325010;
double r325012 = y;
double r325013 = z;
double r325014 = t;
double r325015 = r325013 - r325014;
double r325016 = r325009 / r325015;
double r325017 = r325012 / r325016;
double r325018 = x;
double r325019 = r325017 + r325018;
double r325020 = 3.7574005919343346e+65;
bool r325021 = r325009 <= r325020;
double r325022 = r325012 * r325015;
double r325023 = r325022 / r325009;
double r325024 = r325023 + r325018;
double r325025 = r325015 / r325009;
double r325026 = fma(r325012, r325025, r325018);
double r325027 = r325021 ? r325024 : r325026;
double r325028 = r325011 ? r325019 : r325027;
return r325028;
}




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 | 1.2 |
if a < -1.3995028580527438e+104Initial program 12.4
Simplified2.3
rmApplied fma-udef2.3
Simplified12.4
rmApplied associate-/l*0.7
if -1.3995028580527438e+104 < a < 3.7574005919343346e+65Initial program 1.6
Simplified3.0
rmApplied fma-udef3.0
Simplified1.6
if 3.7574005919343346e+65 < a Initial program 10.0
Simplified2.0
rmApplied fma-udef2.0
Simplified10.0
rmApplied *-un-lft-identity10.0
Applied times-frac0.7
Applied fma-def0.7
Final simplification1.2
herbie shell --seed 2020045 +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)))