\frac{x - \sin x}{x - \tan x}\begin{array}{l}
\mathbf{if}\;\frac{x - \sin x}{x - \tan x} \leq 1.0000000000049678:\\
\;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin x}}\\
\mathbf{else}:\\
\;\;\;\;-0.5\\
\end{array}(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x) :precision binary64 (if (<= (/ (- x (sin x)) (- x (tan x))) 1.0000000000049678) (/ 1.0 (/ (- x (tan x)) (- x (sin x)))) -0.5))
double code(double x) {
return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
double tmp;
if (((x - sin(x)) / (x - tan(x))) <= 1.0000000000049678) {
tmp = 1.0 / ((x - tan(x)) / (x - sin(x)));
} else {
tmp = -0.5;
}
return tmp;
}



Bits error versus x
Results
if (/.f64 (-.f64 x (sin.f64 x)) (-.f64 x (tan.f64 x))) < 1.0000000000049678Initial program 0.6
rmApplied clear-num_binary640.6
if 1.0000000000049678 < (/.f64 (-.f64 x (sin.f64 x)) (-.f64 x (tan.f64 x))) Initial program 63.2
Taylor expanded around 0 0.8
Final simplification0.7
herbie shell --seed 2021032
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))