\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \leq -2.208632844132881:\\
\;\;\;\;\left(\left(1 + \frac{\sin x}{x \cdot \cos x}\right) + \frac{\sin x}{x \cdot x} \cdot \left(\frac{\sin x}{{\cos x}^{2}} - \frac{\sin x}{\cos x}\right)\right) - \frac{\sin x}{x}\\
\mathbf{elif}\;x \leq 0.003965314230899635:\\
\;\;\;\;0.225 \cdot {x}^{2} - 0.5\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\
\end{array}
(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
:precision binary64
(if (<= x -2.208632844132881)
(-
(+
(+ 1.0 (/ (sin x) (* x (cos x))))
(*
(/ (sin x) (* x x))
(- (/ (sin x) (pow (cos x) 2.0)) (/ (sin x) (cos x)))))
(/ (sin x) x))
(if (<= x 0.003965314230899635)
(- (* 0.225 (pow x 2.0)) 0.5)
(log (exp (/ (- x (sin x)) (- x (tan x))))))))double code(double x) {
return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
double tmp;
if (x <= -2.208632844132881) {
tmp = ((1.0 + (sin(x) / (x * cos(x)))) + ((sin(x) / (x * x)) * ((sin(x) / pow(cos(x), 2.0)) - (sin(x) / cos(x))))) - (sin(x) / x);
} else if (x <= 0.003965314230899635) {
tmp = (0.225 * pow(x, 2.0)) - 0.5;
} else {
tmp = log(exp((x - sin(x)) / (x - tan(x))));
}
return tmp;
}



Bits error versus x
Results
if x < -2.20863284413288108Initial program 0.0
Taylor expanded in x around inf 0.4
Simplified0.4
if -2.20863284413288108 < x < 0.00396531423089963465Initial program 63.1
Taylor expanded in x around 0 0.1
if 0.00396531423089963465 < x Initial program 0.1
Applied add-log-exp_binary640.1
Final simplification0.2
herbie shell --seed 2021215
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))