\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \leq -2.594104887854674:\\
\;\;\;\;\begin{array}{l}
t_0 := x \cdot \cos x\\
t_1 := {\sin x}^{2}\\
t_2 := {\cos x}^{2}\\
\left(1 + \left(\frac{t_1}{\left(x \cdot x\right) \cdot t_2} + \frac{{\left(\frac{\sin x}{\cos x}\right)}^{3}}{{x}^{3}}\right)\right) + \left(\frac{\sin x}{t_0} - \left(\left(\frac{\sin x}{x} + \frac{t_1}{x \cdot t_0}\right) + \frac{{\sin x}^{3}}{t_2 \cdot {x}^{3}}\right)\right)
\end{array}\\
\mathbf{elif}\;x \leq 0.09629485008899653:\\
\;\;\;\;\mathsf{fma}\left(0.225, x \cdot x, \mathsf{fma}\left({x}^{4}, -0.009642857142857142, 0.00024107142857142857 \cdot {x}^{6}\right)\right) - 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x - \tan x}{x - \sin x}}\\
\end{array}
(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
:precision binary64
(if (<= x -2.594104887854674)
(let* ((t_0 (* x (cos x))) (t_1 (pow (sin x) 2.0)) (t_2 (pow (cos x) 2.0)))
(+
(+
1.0
(+
(/ t_1 (* (* x x) t_2))
(/ (pow (/ (sin x) (cos x)) 3.0) (pow x 3.0))))
(-
(/ (sin x) t_0)
(+
(+ (/ (sin x) x) (/ t_1 (* x t_0)))
(/ (pow (sin x) 3.0) (* t_2 (pow x 3.0)))))))
(if (<= x 0.09629485008899653)
(-
(fma
0.225
(* x x)
(fma
(pow x 4.0)
-0.009642857142857142
(* 0.00024107142857142857 (pow x 6.0))))
0.5)
(/ 1.0 (/ (- x (tan x)) (- x (sin x)))))))double code(double x) {
return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
double tmp;
if (x <= -2.594104887854674) {
double t_0_1 = x * cos(x);
double t_1_2 = pow(sin(x), 2.0);
double t_2_3 = pow(cos(x), 2.0);
tmp = (1.0 + ((t_1_2 / ((x * x) * t_2_3)) + (pow((sin(x) / cos(x)), 3.0) / pow(x, 3.0)))) + ((sin(x) / t_0_1) - (((sin(x) / x) + (t_1_2 / (x * t_0_1))) + (pow(sin(x), 3.0) / (t_2_3 * pow(x, 3.0)))));
} else if (x <= 0.09629485008899653) {
tmp = fma(0.225, (x * x), fma(pow(x, 4.0), -0.009642857142857142, (0.00024107142857142857 * pow(x, 6.0)))) - 0.5;
} else {
tmp = 1.0 / ((x - tan(x)) / (x - sin(x)));
}
return tmp;
}



Bits error versus x
if x < -2.594104887854674Initial program 0.0
Taylor expanded in x around inf 0.3
Simplified0.3
if -2.594104887854674 < x < 0.0962948500889965336Initial program 62.7
Taylor expanded in x around 0 0.1
Simplified0.1
Applied fma-udef_binary640.1
Applied associate--r+_binary640.1
Simplified0.1
if 0.0962948500889965336 < x Initial program 0.0
Applied clear-num_binary640.0
Final simplification0.1
herbie shell --seed 2021224
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))