\frac{x - \sin x}{x - \tan x}\begin{array}{l}
\mathbf{if}\;x \le -4.638405512419418:\\
\;\;\;\;e^{\log \left(\frac{x - \sin x}{x - \tan x}\right)}\\
\mathbf{elif}\;x \le 1.5588973207876802:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(\frac{9}{40} - \left(x \cdot x\right) \cdot \frac{27}{2800}\right) - \frac{1}{2}\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\frac{x - \sin x}{x - \tan x}\right)}\\
\end{array}double f(double x) {
double r712716 = x;
double r712717 = sin(r712716);
double r712718 = r712716 - r712717;
double r712719 = tan(r712716);
double r712720 = r712716 - r712719;
double r712721 = r712718 / r712720;
return r712721;
}
double f(double x) {
double r712722 = x;
double r712723 = -4.638405512419418;
bool r712724 = r712722 <= r712723;
double r712725 = sin(r712722);
double r712726 = r712722 - r712725;
double r712727 = tan(r712722);
double r712728 = r712722 - r712727;
double r712729 = r712726 / r712728;
double r712730 = log(r712729);
double r712731 = exp(r712730);
double r712732 = 1.5588973207876802;
bool r712733 = r712722 <= r712732;
double r712734 = r712722 * r712722;
double r712735 = 0.225;
double r712736 = 0.009642857142857142;
double r712737 = r712734 * r712736;
double r712738 = r712735 - r712737;
double r712739 = r712734 * r712738;
double r712740 = 0.5;
double r712741 = r712739 - r712740;
double r712742 = r712733 ? r712741 : r712731;
double r712743 = r712724 ? r712731 : r712742;
return r712743;
}



Bits error versus x
Results
if x < -4.638405512419418 or 1.5588973207876802 < x Initial program 0.0
rmApplied add-exp-log0.0
if -4.638405512419418 < x < 1.5588973207876802Initial program 62.3
Taylor expanded around 0 0.2
Simplified0.2
Final simplification0.1
herbie shell --seed 2019138 +o rules:numerics
(FPCore (x)
:name "sintan (problem 3.4.5)"
(/ (- x (sin x)) (- x (tan x))))