\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.012741487861675:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\tan \left(\frac{x}{y \cdot 2}\right)}{\sin \left(\frac{x}{y \cdot 2}\right)}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r1192901 = x;
double r1192902 = y;
double r1192903 = 2.0;
double r1192904 = r1192902 * r1192903;
double r1192905 = r1192901 / r1192904;
double r1192906 = tan(r1192905);
double r1192907 = sin(r1192905);
double r1192908 = r1192906 / r1192907;
return r1192908;
}
double f(double x, double y) {
double r1192909 = x;
double r1192910 = y;
double r1192911 = 2.0;
double r1192912 = r1192910 * r1192911;
double r1192913 = r1192909 / r1192912;
double r1192914 = tan(r1192913);
double r1192915 = sin(r1192913);
double r1192916 = r1192914 / r1192915;
double r1192917 = 1.0127414878616747;
bool r1192918 = r1192916 <= r1192917;
double r1192919 = expm1(r1192916);
double r1192920 = expm1(r1192919);
double r1192921 = log1p(r1192920);
double r1192922 = log1p(r1192921);
double r1192923 = 1.0;
double r1192924 = r1192918 ? r1192922 : r1192923;
return r1192924;
}




Bits error versus x




Bits error versus y
Results
| Original | 35.5 |
|---|---|
| Target | 29.0 |
| Herbie | 28.0 |
if (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) < 1.0127414878616747Initial program 19.0
rmApplied log1p-expm1-u19.1
rmApplied log1p-expm1-u19.1
if 1.0127414878616747 < (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) Initial program 60.1
Taylor expanded around 0 41.4
Final simplification28.0
herbie shell --seed 2020025 +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)))))