\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{x}{2.0 \cdot y} \le 4.3945246018946 \cdot 10^{-310}:\\
\;\;\;\;1.0\\
\mathbf{elif}\;\frac{x}{2.0 \cdot y} \le 5.725300019950944 \cdot 10^{+237}:\\
\;\;\;\;\frac{\sin \left(\frac{x}{2.0 \cdot y}\right)}{\sin \left(\frac{x}{2.0 \cdot y}\right) \cdot \cos \left(\frac{x}{2.0 \cdot y}\right)}\\
\mathbf{else}:\\
\;\;\;\;1.0\\
\end{array}double f(double x, double y) {
double r31707117 = x;
double r31707118 = y;
double r31707119 = 2.0;
double r31707120 = r31707118 * r31707119;
double r31707121 = r31707117 / r31707120;
double r31707122 = tan(r31707121);
double r31707123 = sin(r31707121);
double r31707124 = r31707122 / r31707123;
return r31707124;
}
double f(double x, double y) {
double r31707125 = x;
double r31707126 = 2.0;
double r31707127 = y;
double r31707128 = r31707126 * r31707127;
double r31707129 = r31707125 / r31707128;
double r31707130 = 4.3945246018946e-310;
bool r31707131 = r31707129 <= r31707130;
double r31707132 = 1.0;
double r31707133 = 5.725300019950944e+237;
bool r31707134 = r31707129 <= r31707133;
double r31707135 = sin(r31707129);
double r31707136 = cos(r31707129);
double r31707137 = r31707135 * r31707136;
double r31707138 = r31707135 / r31707137;
double r31707139 = r31707134 ? r31707138 : r31707132;
double r31707140 = r31707131 ? r31707132 : r31707139;
return r31707140;
}




Bits error versus x




Bits error versus y
Results
| Original | 35.3 |
|---|---|
| Target | 29.4 |
| Herbie | 28.4 |
if (/ x (* y 2.0)) < 4.3945246018946e-310 or 5.725300019950944e+237 < (/ x (* y 2.0)) Initial program 41.0
Taylor expanded around 0 30.5
if 4.3945246018946e-310 < (/ x (* y 2.0)) < 5.725300019950944e+237Initial program 24.5
rmApplied tan-quot24.5
rmApplied associate-/l/24.5
Final simplification28.4
herbie shell --seed 2019162
(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)))))