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



Bits error versus x
if x < -0.00487735857689251904Initial program 0.1
if -0.00487735857689251904 < x < 0.0053897304055360116Initial program 63.4
Taylor expanded in x around 0 0.0
Simplified0.0
if 0.0053897304055360116 < x Initial program 0.1
Applied add-log-exp_binary640.1
Final simplification0.0
herbie shell --seed 2022082
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))