\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
t_0 := x - \tan x\\
\mathbf{if}\;x \leq -0.005033392592531496:\\
\;\;\;\;\frac{x}{t_0} - \frac{\sin x}{t_0}\\
\mathbf{elif}\;x \leq 0.005151709527736681:\\
\;\;\;\;\mathsf{fma}\left(0.225, x \cdot x, -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x - \sin x}{t_0}\right)\right)\\
\end{array}
(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
:precision binary64
(let* ((t_0 (- x (tan x))))
(if (<= x -0.005033392592531496)
(- (/ x t_0) (/ (sin x) t_0))
(if (<= x 0.005151709527736681)
(fma 0.225 (* x x) -0.5)
(expm1 (log1p (/ (- x (sin x)) t_0)))))))double code(double x) {
return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
double t_0 = x - tan(x);
double tmp;
if (x <= -0.005033392592531496) {
tmp = (x / t_0) - (sin(x) / t_0);
} else if (x <= 0.005151709527736681) {
tmp = fma(0.225, (x * x), -0.5);
} else {
tmp = expm1(log1p((x - sin(x)) / t_0));
}
return tmp;
}



Bits error versus x
if x < -0.00503339259253149634Initial program 0.1
Applied div-sub_binary640.1
if -0.00503339259253149634 < x < 0.00515170952773668072Initial program 63.3
Taylor expanded in x around 0 0.0
Simplified0.0
if 0.00515170952773668072 < x Initial program 0.1
Applied expm1-log1p-u_binary640.1
Final simplification0.1
herbie shell --seed 2022103
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))