x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -30843645.5034677498:\\
\;\;\;\;y \cdot \frac{z - t}{a} + x\\
\mathbf{elif}\;a \le 5.6925026423385466 \cdot 10^{-40}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{a} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\sqrt{a}} \cdot \frac{z - t}{\sqrt{a}} + x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r360816 = x;
double r360817 = y;
double r360818 = z;
double r360819 = t;
double r360820 = r360818 - r360819;
double r360821 = r360817 * r360820;
double r360822 = a;
double r360823 = r360821 / r360822;
double r360824 = r360816 + r360823;
return r360824;
}
double f(double x, double y, double z, double t, double a) {
double r360825 = a;
double r360826 = -30843645.50346775;
bool r360827 = r360825 <= r360826;
double r360828 = y;
double r360829 = z;
double r360830 = t;
double r360831 = r360829 - r360830;
double r360832 = r360831 / r360825;
double r360833 = r360828 * r360832;
double r360834 = x;
double r360835 = r360833 + r360834;
double r360836 = 5.692502642338547e-40;
bool r360837 = r360825 <= r360836;
double r360838 = r360831 * r360828;
double r360839 = r360838 / r360825;
double r360840 = r360839 + r360834;
double r360841 = sqrt(r360825);
double r360842 = r360828 / r360841;
double r360843 = r360831 / r360841;
double r360844 = r360842 * r360843;
double r360845 = r360844 + r360834;
double r360846 = r360837 ? r360840 : r360845;
double r360847 = r360827 ? r360835 : r360846;
return r360847;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 5.9 |
|---|---|
| Target | 0.8 |
| Herbie | 0.8 |
if a < -30843645.50346775Initial program 9.4
Simplified1.8
rmApplied fma-udef1.8
rmApplied div-inv1.8
Applied associate-*l*0.8
Simplified0.8
if -30843645.50346775 < a < 5.692502642338547e-40Initial program 0.9
Simplified4.4
rmApplied fma-udef4.4
Taylor expanded around 0 0.9
Simplified0.9
if 5.692502642338547e-40 < a Initial program 8.0
Simplified1.9
rmApplied fma-udef1.9
rmApplied div-inv1.9
Applied associate-*l*0.7
Simplified0.7
rmApplied add-sqr-sqrt0.8
Applied *-un-lft-identity0.8
Applied times-frac0.8
Applied associate-*r*0.9
Simplified0.8
Final simplification0.8
herbie shell --seed 2020057 +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)))