\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\begin{array}{l}
\mathbf{if}\;\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \le 2.696758195644417099856582353822886943817:\\
\;\;\;\;\sqrt[3]{\sqrt[3]{{\left({\left(\left(\sqrt[3]{\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}} \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}}\right) \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}}\right)}^{3}\right)}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r572837 = x;
double r572838 = y;
double r572839 = 2.0;
double r572840 = r572838 * r572839;
double r572841 = r572837 / r572840;
double r572842 = tan(r572841);
double r572843 = sin(r572841);
double r572844 = r572842 / r572843;
return r572844;
}
double f(double x, double y) {
double r572845 = x;
double r572846 = y;
double r572847 = 2.0;
double r572848 = r572846 * r572847;
double r572849 = r572845 / r572848;
double r572850 = tan(r572849);
double r572851 = sin(r572849);
double r572852 = r572850 / r572851;
double r572853 = 2.696758195644417;
bool r572854 = r572852 <= r572853;
double r572855 = cbrt(r572852);
double r572856 = r572855 * r572855;
double r572857 = r572856 * r572855;
double r572858 = 3.0;
double r572859 = pow(r572857, r572858);
double r572860 = pow(r572859, r572858);
double r572861 = cbrt(r572860);
double r572862 = cbrt(r572861);
double r572863 = 1.0;
double r572864 = r572854 ? r572862 : r572863;
return r572864;
}




Bits error versus x




Bits error versus y
Results
| Original | 35.9 |
|---|---|
| Target | 28.9 |
| Herbie | 27.8 |
if (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) < 2.696758195644417Initial program 25.1
rmApplied add-cbrt-cube45.5
Applied add-cbrt-cube45.1
Applied cbrt-undiv45.1
Simplified25.1
rmApplied add-cbrt-cube25.1
Simplified25.1
rmApplied add-cube-cbrt25.1
if 2.696758195644417 < (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) Initial program 62.7
Taylor expanded around 0 34.5
Final simplification27.8
herbie shell --seed 2019212
(FPCore (x y)
:name "Diagrams.TwoD.Layout.CirclePacking:approxRadius from diagrams-contrib-1.3.0.5"
:precision binary64
:herbie-target
(if (< y -1.23036909113069936e114) 1 (if (< y -9.1028524068119138e-222) (/ (sin (/ x (* y 2))) (* (sin (/ x (* y 2))) (log (exp (cos (/ x (* y 2))))))) 1))
(/ (tan (/ x (* y 2))) (sin (/ x (* y 2)))))