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



Bits error versus x
if x < -0.0323266399932167284Initial program 0.0
Taylor expanded in x around inf 0.0
if -0.0323266399932167284 < x < 2.6632315197980545Initial program 63.0
Taylor expanded in x around 0 0.1
Simplified0.1
if 2.6632315197980545 < x Initial program 0.0
Taylor expanded in x around inf 0.5
Simplified0.5
Taylor expanded in x around inf 0.5
Final simplification0.2
herbie shell --seed 2021357
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))