\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 1.0997944018617001:\\
\;\;\;\;\mathsf{log1p}\left(\sqrt[3]{{\left(\mathsf{expm1}\left(\frac{1}{\cos \left(\frac{x}{y \cdot 2}\right)}\right)\right)}^{3}}\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r668596 = x;
double r668597 = y;
double r668598 = 2.0;
double r668599 = r668597 * r668598;
double r668600 = r668596 / r668599;
double r668601 = tan(r668600);
double r668602 = sin(r668600);
double r668603 = r668601 / r668602;
return r668603;
}
double f(double x, double y) {
double r668604 = x;
double r668605 = y;
double r668606 = 2.0;
double r668607 = r668605 * r668606;
double r668608 = r668604 / r668607;
double r668609 = tan(r668608);
double r668610 = sin(r668608);
double r668611 = r668609 / r668610;
double r668612 = 1.0997944018617;
bool r668613 = r668611 <= r668612;
double r668614 = 1.0;
double r668615 = cos(r668608);
double r668616 = r668614 / r668615;
double r668617 = expm1(r668616);
double r668618 = 3.0;
double r668619 = pow(r668617, r668618);
double r668620 = cbrt(r668619);
double r668621 = log1p(r668620);
double r668622 = 1.0;
double r668623 = r668613 ? r668621 : r668622;
return r668623;
}




Bits error versus x




Bits error versus y
Results
| Original | 35.8 |
|---|---|
| Target | 29.0 |
| Herbie | 27.9 |
if (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) < 1.0997944018617Initial program 21.3
rmApplied tan-quot21.3
rmApplied log1p-expm1-u21.4
Simplified21.4
rmApplied add-cbrt-cube21.4
Simplified21.4
if 1.0997944018617 < (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) Initial program 60.9
Taylor expanded around 0 39.1
Final simplification27.9
herbie shell --seed 2020045 +o rules:numerics
(FPCore (x y)
:name "Diagrams.TwoD.Layout.CirclePacking:approxRadius from diagrams-contrib-1.3.0.5"
:precision binary64
:herbie-target
(if (< y -1.2303690911306994e+114) 1 (if (< y -9.102852406811914e-222) (/ (sin (/ x (* y 2))) (* (sin (/ x (* y 2))) (log (exp (cos (/ x (* y 2))))))) 1))
(/ (tan (/ x (* y 2))) (sin (/ x (* y 2)))))