\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
\mathbf{if}\;x \leq -0.09740715512336516:\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\
\mathbf{elif}\;x \leq 4.99533306627316:\\
\;\;\;\;\mathsf{fma}\left(0.225, x \cdot x, 0.00024107142857142857 \cdot {x}^{6}\right) - \mathsf{fma}\left(0.009642857142857142, {x}^{4}, 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0 + \left(\frac{\tan x}{x} + \left(1 - \frac{\sin x}{x}\right)\right)\\
\end{array}
(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
:precision binary64
(if (<= x -0.09740715512336516)
(/ (- x (sin x)) (- x (tan x)))
(if (<= x 4.99533306627316)
(-
(fma 0.225 (* x x) (* 0.00024107142857142857 (pow x 6.0)))
(fma 0.009642857142857142 (pow x 4.0) 0.5))
(+ 0.0 (+ (/ (tan x) x) (- 1.0 (/ (sin x) x)))))))double code(double x) {
return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
double tmp;
if (x <= -0.09740715512336516) {
tmp = (x - sin(x)) / (x - tan(x));
} else if (x <= 4.99533306627316) {
tmp = fma(0.225, (x * x), (0.00024107142857142857 * pow(x, 6.0))) - fma(0.009642857142857142, pow(x, 4.0), 0.5);
} else {
tmp = 0.0 + ((tan(x) / x) + (1.0 - (sin(x) / x)));
}
return tmp;
}



Bits error versus x
if x < -0.0974071551233651606Initial program 0.0
if -0.0974071551233651606 < x < 4.9953330662731599Initial program 62.9
Taylor expanded in x around 0 0.1
Simplified0.1
if 4.9953330662731599 < x Initial program 0.0
Taylor expanded in x around inf 0.5
Applied egg-rr0.5
Final simplification0.2
herbie shell --seed 2022129
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))