\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 5.551201649719668118621029861969873309135:\\
\;\;\;\;\log \left(\log \left(e^{{\left(e^{1}\right)}^{\left(\frac{1}{\cos \left(\frac{x}{y \cdot 2}\right)}\right)}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r529851 = x;
double r529852 = y;
double r529853 = 2.0;
double r529854 = r529852 * r529853;
double r529855 = r529851 / r529854;
double r529856 = tan(r529855);
double r529857 = sin(r529855);
double r529858 = r529856 / r529857;
return r529858;
}
double f(double x, double y) {
double r529859 = x;
double r529860 = y;
double r529861 = 2.0;
double r529862 = r529860 * r529861;
double r529863 = r529859 / r529862;
double r529864 = tan(r529863);
double r529865 = sin(r529863);
double r529866 = r529864 / r529865;
double r529867 = 5.551201649719668;
bool r529868 = r529866 <= r529867;
double r529869 = 1.0;
double r529870 = exp(r529869);
double r529871 = cos(r529863);
double r529872 = r529869 / r529871;
double r529873 = pow(r529870, r529872);
double r529874 = exp(r529873);
double r529875 = log(r529874);
double r529876 = log(r529875);
double r529877 = 1.0;
double r529878 = r529868 ? r529876 : r529877;
return r529878;
}




Bits error versus x




Bits error versus y
Results
| Original | 35.8 |
|---|---|
| Target | 28.8 |
| Herbie | 27.7 |
if (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) < 5.551201649719668Initial program 25.9
rmApplied tan-quot25.9
Applied associate-/l/25.9
rmApplied add-log-exp25.9
Simplified25.9
rmApplied add-log-exp25.9
if 5.551201649719668 < (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) Initial program 63.3
Taylor expanded around 0 32.5
Final simplification27.7
herbie shell --seed 1978988140
(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)))))