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(\frac{z - t}{a}, y, x\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r333022 = x;
double r333023 = y;
double r333024 = z;
double r333025 = t;
double r333026 = r333024 - r333025;
double r333027 = r333023 * r333026;
double r333028 = a;
double r333029 = r333027 / r333028;
double r333030 = r333022 + r333029;
return r333030;
}
double f(double x, double y, double z, double t, double a) {
double r333031 = a;
double r333032 = -1.3995028580527438e+104;
bool r333033 = r333031 <= r333032;
double r333034 = y;
double r333035 = z;
double r333036 = t;
double r333037 = r333035 - r333036;
double r333038 = r333031 / r333037;
double r333039 = r333034 / r333038;
double r333040 = x;
double r333041 = r333039 + r333040;
double r333042 = 3.7574005919343346e+65;
bool r333043 = r333031 <= r333042;
double r333044 = r333034 * r333037;
double r333045 = r333044 / r333031;
double r333046 = r333045 + r333040;
double r333047 = r333037 / r333031;
double r333048 = fma(r333047, r333034, r333040);
double r333049 = r333043 ? r333046 : r333048;
double r333050 = r333033 ? r333041 : r333049;
return r333050;
}




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
Taylor expanded around 0 10.0
Simplified2.2
rmApplied *-un-lft-identity2.2
Applied *-un-lft-identity2.2
Applied distribute-lft-out2.2
Simplified0.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)))