\frac{\tan \left(\frac{x}{y \cdot 2.0}\right)}{\sin \left(\frac{x}{y \cdot 2.0}\right)}\begin{array}{l}
\mathbf{if}\;\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)} \le 2.551995579119875:\\
\;\;\;\;\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(0.5 \cdot \frac{x}{y}\right)}\\
\mathbf{else}:\\
\;\;\;\;1.0\\
\end{array}double f(double x, double y) {
double r34469822 = x;
double r34469823 = y;
double r34469824 = 2.0;
double r34469825 = r34469823 * r34469824;
double r34469826 = r34469822 / r34469825;
double r34469827 = tan(r34469826);
double r34469828 = sin(r34469826);
double r34469829 = r34469827 / r34469828;
return r34469829;
}
double f(double x, double y) {
double r34469830 = x;
double r34469831 = 2.0;
double r34469832 = y;
double r34469833 = r34469831 * r34469832;
double r34469834 = r34469830 / r34469833;
double r34469835 = tan(r34469834);
double r34469836 = sin(r34469834);
double r34469837 = r34469835 / r34469836;
double r34469838 = 2.551995579119875;
bool r34469839 = r34469837 <= r34469838;
double r34469840 = 0.5;
double r34469841 = r34469830 / r34469832;
double r34469842 = r34469840 * r34469841;
double r34469843 = sin(r34469842);
double r34469844 = r34469835 / r34469843;
double r34469845 = 1.0;
double r34469846 = r34469839 ? r34469844 : r34469845;
return r34469846;
}




Bits error versus x




Bits error versus y
Results
| Original | 35.2 |
|---|---|
| Target | 28.4 |
| Herbie | 27.3 |
if (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) < 2.551995579119875Initial program 24.7
Taylor expanded around 0 24.8
if 2.551995579119875 < (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) Initial program 61.5
Taylor expanded around 0 33.6
Final simplification27.3
herbie shell --seed 2019158
(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)))))