\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 r19690 = x;
double r19691 = sin(r19690);
double r19692 = r19690 - r19691;
double r19693 = tan(r19690);
double r19694 = r19690 - r19693;
double r19695 = r19692 / r19694;
return r19695;
}
double f(double x) {
double r19696 = x;
double r19697 = -0.030293763080502873;
bool r19698 = r19696 <= r19697;
double r19699 = sin(r19696);
double r19700 = r19696 - r19699;
double r19701 = tan(r19696);
double r19702 = r19696 - r19701;
double r19703 = r19700 / r19702;
double r19704 = 2.401275434249347;
bool r19705 = r19696 <= r19704;
double r19706 = 0.225;
double r19707 = 2.0;
double r19708 = pow(r19696, r19707);
double r19709 = r19706 * r19708;
double r19710 = exp(r19709);
double r19711 = log(r19710);
double r19712 = 0.009642857142857142;
double r19713 = 4.0;
double r19714 = pow(r19696, r19713);
double r19715 = r19712 * r19714;
double r19716 = r19711 - r19715;
double r19717 = 0.5;
double r19718 = r19716 - r19717;
double r19719 = cos(r19696);
double r19720 = r19696 * r19719;
double r19721 = r19699 / r19720;
double r19722 = 1.0;
double r19723 = r19721 + r19722;
double r19724 = r19708 * r19719;
double r19725 = r19699 / r19724;
double r19726 = r19699 / r19719;
double r19727 = r19726 - r19699;
double r19728 = r19725 * r19727;
double r19729 = r19723 + r19728;
double r19730 = r19699 / r19696;
double r19731 = r19729 - r19730;
double r19732 = r19705 ? r19718 : r19731;
double r19733 = r19698 ? r19703 : r19732;
return r19733;
}



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))))