\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 16.799894871361925:\\
\;\;\;\;\left(\sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\frac{x}{2.0 \cdot y}\right)\right)\right)}} \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right)}}\right) \cdot \sqrt[3]{\frac{\tan \left(\frac{x}{2.0 \cdot y}\right)}{\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\frac{x}{2.0 \cdot y}\right)\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;1.0\\
\end{array}double f(double x, double y) {
double r11090109 = x;
double r11090110 = y;
double r11090111 = 2.0;
double r11090112 = r11090110 * r11090111;
double r11090113 = r11090109 / r11090112;
double r11090114 = tan(r11090113);
double r11090115 = sin(r11090113);
double r11090116 = r11090114 / r11090115;
return r11090116;
}
double f(double x, double y) {
double r11090117 = x;
double r11090118 = 2.0;
double r11090119 = y;
double r11090120 = r11090118 * r11090119;
double r11090121 = r11090117 / r11090120;
double r11090122 = tan(r11090121);
double r11090123 = sin(r11090121);
double r11090124 = r11090122 / r11090123;
double r11090125 = 16.799894871361925;
bool r11090126 = r11090124 <= r11090125;
double r11090127 = expm1(r11090123);
double r11090128 = log1p(r11090127);
double r11090129 = r11090122 / r11090128;
double r11090130 = cbrt(r11090129);
double r11090131 = cbrt(r11090124);
double r11090132 = r11090130 * r11090131;
double r11090133 = r11090132 * r11090130;
double r11090134 = 1.0;
double r11090135 = r11090126 ? r11090133 : r11090134;
return r11090135;
}




Bits error versus x




Bits error versus y
Results
| Original | 35.2 |
|---|---|
| Target | 28.9 |
| Herbie | 27.5 |
if (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) < 16.799894871361925Initial program 26.4
rmApplied add-cube-cbrt26.4
rmApplied log1p-expm1-u26.4
rmApplied log1p-expm1-u26.4
if 16.799894871361925 < (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))) Initial program 62.2
Taylor expanded around 0 30.8
Final simplification27.5
herbie shell --seed 2019156 +o rules:numerics
(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)))))