\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 r666588 = x;
double r666589 = y;
double r666590 = 2.0;
double r666591 = r666589 * r666590;
double r666592 = r666588 / r666591;
double r666593 = tan(r666592);
double r666594 = sin(r666592);
double r666595 = r666593 / r666594;
return r666595;
}
double f(double x, double y) {
double r666596 = x;
double r666597 = y;
double r666598 = 2.0;
double r666599 = r666597 * r666598;
double r666600 = r666596 / r666599;
double r666601 = tan(r666600);
double r666602 = sin(r666600);
double r666603 = r666601 / r666602;
double r666604 = 1.0997944018617;
bool r666605 = r666603 <= r666604;
double r666606 = 1.0;
double r666607 = cos(r666600);
double r666608 = r666606 / r666607;
double r666609 = expm1(r666608);
double r666610 = 3.0;
double r666611 = pow(r666609, r666610);
double r666612 = cbrt(r666611);
double r666613 = log1p(r666612);
double r666614 = 1.0;
double r666615 = r666605 ? r666613 : r666614;
return r666615;
}




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)))))