x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -5.8671698741040733 \cdot 10^{-19}:\\
\;\;\;\;y \cdot \frac{t - z}{a} + x\\
\mathbf{elif}\;a \le 1.2727793494611607 \cdot 10^{53}:\\
\;\;\;\;1 \cdot \frac{\left(t - z\right) \cdot y}{a} + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - z, x\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r272141 = x;
double r272142 = y;
double r272143 = z;
double r272144 = t;
double r272145 = r272143 - r272144;
double r272146 = r272142 * r272145;
double r272147 = a;
double r272148 = r272146 / r272147;
double r272149 = r272141 - r272148;
return r272149;
}
double f(double x, double y, double z, double t, double a) {
double r272150 = a;
double r272151 = -5.867169874104073e-19;
bool r272152 = r272150 <= r272151;
double r272153 = y;
double r272154 = t;
double r272155 = z;
double r272156 = r272154 - r272155;
double r272157 = r272156 / r272150;
double r272158 = r272153 * r272157;
double r272159 = x;
double r272160 = r272158 + r272159;
double r272161 = 1.2727793494611607e+53;
bool r272162 = r272150 <= r272161;
double r272163 = 1.0;
double r272164 = r272156 * r272153;
double r272165 = r272164 / r272150;
double r272166 = r272163 * r272165;
double r272167 = r272166 + r272159;
double r272168 = r272153 / r272150;
double r272169 = fma(r272168, r272156, r272159);
double r272170 = r272162 ? r272167 : r272169;
double r272171 = r272152 ? r272160 : r272170;
return r272171;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 6.2 |
|---|---|
| Target | 0.8 |
| Herbie | 1.3 |
if a < -5.867169874104073e-19Initial program 9.0
Simplified1.6
rmApplied fma-udef1.6
rmApplied div-inv1.6
Applied associate-*l*0.6
Simplified0.6
if -5.867169874104073e-19 < a < 1.2727793494611607e+53Initial program 1.3
Simplified3.4
rmApplied fma-udef3.4
rmApplied *-un-lft-identity3.4
Applied *-un-lft-identity3.4
Applied times-frac3.4
Applied associate-*l*3.4
Simplified1.3
if 1.2727793494611607e+53 < a Initial program 10.3
Simplified2.0
Final simplification1.3
herbie shell --seed 2020033 +o rules:numerics
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
: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)))