x + \frac{y \cdot \left(z - t\right)}{a}\begin{array}{l}
\mathbf{if}\;a \le -2.717101417616620114043785351731635839082 \cdot 10^{48}:\\
\;\;\;\;\left(\left(z - t\right) \cdot \frac{1}{\frac{a}{\sqrt[3]{y}}}\right) \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) + x\\
\mathbf{elif}\;a \le 72135089252230804599899465539374389657600:\\
\;\;\;\;x + \frac{1}{a} \cdot \left(y \cdot \left(z - t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, -\frac{t}{\frac{a}{y}}\right) + x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r232673 = x;
double r232674 = y;
double r232675 = z;
double r232676 = t;
double r232677 = r232675 - r232676;
double r232678 = r232674 * r232677;
double r232679 = a;
double r232680 = r232678 / r232679;
double r232681 = r232673 + r232680;
return r232681;
}
double f(double x, double y, double z, double t, double a) {
double r232682 = a;
double r232683 = -2.71710141761662e+48;
bool r232684 = r232682 <= r232683;
double r232685 = z;
double r232686 = t;
double r232687 = r232685 - r232686;
double r232688 = 1.0;
double r232689 = y;
double r232690 = cbrt(r232689);
double r232691 = r232682 / r232690;
double r232692 = r232688 / r232691;
double r232693 = r232687 * r232692;
double r232694 = r232690 * r232690;
double r232695 = r232693 * r232694;
double r232696 = x;
double r232697 = r232695 + r232696;
double r232698 = 7.21350892522308e+40;
bool r232699 = r232682 <= r232698;
double r232700 = r232688 / r232682;
double r232701 = r232689 * r232687;
double r232702 = r232700 * r232701;
double r232703 = r232696 + r232702;
double r232704 = r232685 / r232682;
double r232705 = r232682 / r232689;
double r232706 = r232686 / r232705;
double r232707 = -r232706;
double r232708 = fma(r232704, r232689, r232707);
double r232709 = r232708 + r232696;
double r232710 = r232699 ? r232703 : r232709;
double r232711 = r232684 ? r232697 : r232710;
return r232711;
}




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 < -2.71710141761662e+48Initial program 10.6
Simplified0.5
rmApplied fma-udef0.5
Simplified0.5
rmApplied clear-num0.6
Simplified1.9
rmApplied *-un-lft-identity1.9
Applied add-cube-cbrt2.2
Applied *-un-lft-identity2.2
Applied times-frac2.2
Applied times-frac0.9
Applied add-cube-cbrt0.9
Applied times-frac0.9
Simplified0.9
Simplified0.9
if -2.71710141761662e+48 < a < 7.21350892522308e+40Initial program 1.2
Simplified11.8
rmApplied fma-udef11.8
Simplified10.8
rmApplied div-inv10.8
Applied *-un-lft-identity10.8
Applied times-frac1.4
Simplified1.3
if 7.21350892522308e+40 < a Initial program 9.5
Simplified0.4
rmApplied fma-udef0.4
Simplified0.5
Taylor expanded around 0 9.5
Simplified1.3
Final simplification1.2
herbie shell --seed 2019194 +o rules:numerics
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:herbie-target
(if (< y -1.0761266216389975e-10) (+ x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))