\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 r555330 = x;
double r555331 = y;
double r555332 = 2.0;
double r555333 = r555331 * r555332;
double r555334 = r555330 / r555333;
double r555335 = tan(r555334);
double r555336 = sin(r555334);
double r555337 = r555335 / r555336;
return r555337;
}
double f(double x, double y) {
double r555338 = x;
double r555339 = y;
double r555340 = 2.0;
double r555341 = r555339 * r555340;
double r555342 = r555338 / r555341;
double r555343 = tan(r555342);
double r555344 = sin(r555342);
double r555345 = r555343 / r555344;
double r555346 = 1.0997944018617;
bool r555347 = r555345 <= r555346;
double r555348 = 1.0;
double r555349 = cos(r555342);
double r555350 = r555348 / r555349;
double r555351 = 1.0;
double r555352 = r555347 ? r555350 : r555351;
return r555352;
}




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 *-un-lft-identity21.3
Applied times-frac21.3
Applied times-frac21.3
Simplified21.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)))))