\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.4360175661597152:\\
\;\;\;\;\sqrt[3]{\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)} \cdot {\left(\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r490293 = x;
double r490294 = y;
double r490295 = 2.0;
double r490296 = r490294 * r490295;
double r490297 = r490293 / r490296;
double r490298 = tan(r490297);
double r490299 = sin(r490297);
double r490300 = r490298 / r490299;
return r490300;
}
double f(double x, double y) {
double r490301 = x;
double r490302 = y;
double r490303 = 2.0;
double r490304 = r490302 * r490303;
double r490305 = r490301 / r490304;
double r490306 = tan(r490305);
double r490307 = sin(r490305);
double r490308 = r490306 / r490307;
double r490309 = 2.436017566159715;
bool r490310 = r490308 <= r490309;
double r490311 = 2.0;
double r490312 = pow(r490308, r490311);
double r490313 = r490308 * r490312;
double r490314 = cbrt(r490313);
double r490315 = 1.0;
double r490316 = r490310 ? r490314 : r490315;
return r490316;
}




Bits error versus x




Bits error versus y
Results
| Original | 35.1 |
|---|---|
| Target | 28.6 |
| Herbie | 27.3 |
if (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) < 2.436017566159715Initial program 24.2
rmApplied add-cbrt-cube45.5
Applied add-cbrt-cube45.1
Applied cbrt-undiv45.1
Simplified24.2
rmApplied cube-mult24.2
Simplified24.2
if 2.436017566159715 < (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) Initial program 62.4
Taylor expanded around 0 34.8
Final simplification27.3
herbie shell --seed 2019198 +o rules:numerics
(FPCore (x y)
:name "Diagrams.TwoD.Layout.CirclePacking:approxRadius from diagrams-contrib-1.3.0.5"
:herbie-target
(if (< y -1.2303690911306994e+114) 1.0 (if (< y -9.102852406811914e-222) (/ (sin (/ x (* y 2.0))) (* (sin (/ x (* y 2.0))) (log (exp (cos (/ x (* y 2.0))))))) 1.0))
(/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))))