\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:\\
\;\;\;\;\frac{1}{\cos \left(\frac{x}{y \cdot 2}\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r691560 = x;
double r691561 = y;
double r691562 = 2.0;
double r691563 = r691561 * r691562;
double r691564 = r691560 / r691563;
double r691565 = tan(r691564);
double r691566 = sin(r691564);
double r691567 = r691565 / r691566;
return r691567;
}
double f(double x, double y) {
double r691568 = x;
double r691569 = y;
double r691570 = 2.0;
double r691571 = r691569 * r691570;
double r691572 = r691568 / r691571;
double r691573 = tan(r691572);
double r691574 = sin(r691572);
double r691575 = r691573 / r691574;
double r691576 = 1.0997944018617;
bool r691577 = r691575 <= r691576;
double r691578 = 1.0;
double r691579 = cos(r691572);
double r691580 = r691578 / r691579;
double r691581 = 1.0;
double r691582 = r691577 ? r691580 : r691581;
return r691582;
}




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 *-un-lft-identity21.3
Applied *-un-lft-identity21.3
Applied times-frac21.3
Applied associate-/l*21.3
Simplified21.3
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
(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)))))