\frac{x - \sin x}{x - \tan x}\begin{array}{l}
\mathbf{if}\;x \le -0.03029376308050287305850822860975313233212:\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\
\mathbf{elif}\;x \le 2.40127543424934719595853493956383317709:\\
\;\;\;\;\left(\log \left(e^{\frac{9}{40} \cdot {x}^{2}}\right) - \frac{27}{2800} \cdot {x}^{4}\right) - \frac{1}{2}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\sin x}{x \cdot \cos x} + 1\right) + \frac{\sin x}{{x}^{2} \cdot \cos x} \cdot \left(\frac{\sin x}{\cos x} - \sin x\right)\right) - \frac{\sin x}{x}\\
\end{array}double f(double x) {
double r19687 = x;
double r19688 = sin(r19687);
double r19689 = r19687 - r19688;
double r19690 = tan(r19687);
double r19691 = r19687 - r19690;
double r19692 = r19689 / r19691;
return r19692;
}
double f(double x) {
double r19693 = x;
double r19694 = -0.030293763080502873;
bool r19695 = r19693 <= r19694;
double r19696 = sin(r19693);
double r19697 = r19693 - r19696;
double r19698 = tan(r19693);
double r19699 = r19693 - r19698;
double r19700 = r19697 / r19699;
double r19701 = 2.401275434249347;
bool r19702 = r19693 <= r19701;
double r19703 = 0.225;
double r19704 = 2.0;
double r19705 = pow(r19693, r19704);
double r19706 = r19703 * r19705;
double r19707 = exp(r19706);
double r19708 = log(r19707);
double r19709 = 0.009642857142857142;
double r19710 = 4.0;
double r19711 = pow(r19693, r19710);
double r19712 = r19709 * r19711;
double r19713 = r19708 - r19712;
double r19714 = 0.5;
double r19715 = r19713 - r19714;
double r19716 = cos(r19693);
double r19717 = r19693 * r19716;
double r19718 = r19696 / r19717;
double r19719 = 1.0;
double r19720 = r19718 + r19719;
double r19721 = r19705 * r19716;
double r19722 = r19696 / r19721;
double r19723 = r19696 / r19716;
double r19724 = r19723 - r19696;
double r19725 = r19722 * r19724;
double r19726 = r19720 + r19725;
double r19727 = r19696 / r19693;
double r19728 = r19726 - r19727;
double r19729 = r19702 ? r19715 : r19728;
double r19730 = r19695 ? r19700 : r19729;
return r19730;
}



Bits error versus x
Results
if x < -0.030293763080502873Initial program 0.0
if -0.030293763080502873 < x < 2.401275434249347Initial program 63.1
Taylor expanded around 0 0.1
rmApplied associate--r+0.1
rmApplied add-log-exp0.1
if 2.401275434249347 < x Initial program 0.0
Taylor expanded around inf 0.3
Simplified0.3
Final simplification0.2
herbie shell --seed 2019326
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))