x - \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -99560.267414621193893253803253173828125:\\
\;\;\;\;y \cdot \frac{t - z}{a} + x\\
\mathbf{elif}\;a \le 13720.53919203528494108468294143676757812:\\
\;\;\;\;\frac{y \cdot \left(t - z\right)}{a} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{\frac{a}{t - z}}}{\sqrt{1}} + x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r373873 = x;
double r373874 = y;
double r373875 = z;
double r373876 = t;
double r373877 = r373875 - r373876;
double r373878 = r373874 * r373877;
double r373879 = a;
double r373880 = r373878 / r373879;
double r373881 = r373873 - r373880;
return r373881;
}
double f(double x, double y, double z, double t, double a) {
double r373882 = a;
double r373883 = -99560.2674146212;
bool r373884 = r373882 <= r373883;
double r373885 = y;
double r373886 = t;
double r373887 = z;
double r373888 = r373886 - r373887;
double r373889 = r373888 / r373882;
double r373890 = r373885 * r373889;
double r373891 = x;
double r373892 = r373890 + r373891;
double r373893 = 13720.539192035285;
bool r373894 = r373882 <= r373893;
double r373895 = r373885 * r373888;
double r373896 = r373895 / r373882;
double r373897 = r373896 + r373891;
double r373898 = r373882 / r373888;
double r373899 = r373885 / r373898;
double r373900 = 1.0;
double r373901 = sqrt(r373900);
double r373902 = r373899 / r373901;
double r373903 = r373902 + r373891;
double r373904 = r373894 ? r373897 : r373903;
double r373905 = r373884 ? r373892 : r373904;
return r373905;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 6.5 |
|---|---|
| Target | 0.7 |
| Herbie | 0.6 |
if a < -99560.2674146212Initial program 9.7
Simplified1.7
rmApplied fma-udef1.7
rmApplied div-inv1.7
Applied associate-*l*0.4
Simplified0.4
if -99560.2674146212 < a < 13720.539192035285Initial program 0.8
Simplified3.6
rmApplied fma-udef3.6
rmApplied *-un-lft-identity3.6
Applied add-cube-cbrt4.3
Applied times-frac4.3
Applied associate-*l*10.7
rmApplied add-sqr-sqrt10.7
Applied associate-*l*10.7
Simplified10.2
rmApplied associate-*r/4.9
Applied sqrt-div4.9
Applied frac-times1.5
Simplified0.8
Simplified0.8
if 13720.539192035285 < a Initial program 10.4
Simplified1.8
rmApplied fma-udef1.8
rmApplied *-un-lft-identity1.8
Applied add-cube-cbrt2.2
Applied times-frac2.2
Applied associate-*l*0.9
rmApplied add-sqr-sqrt0.9
Applied associate-*l*0.9
Simplified3.0
rmApplied sqrt-div3.0
Applied associate-*l/3.0
Simplified0.6
Final simplification0.6
herbie shell --seed 2019351 +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)))