\frac{x - \sin x}{x - \tan x}\begin{array}{l}
\mathbf{if}\;x \leq -0.02731826339141937:\\
\;\;\;\;\frac{x - \sin x}{x - \tan x}\\
\mathbf{elif}\;x \leq 0.024311694521294346:\\
\;\;\;\;\left(x \cdot x\right) \cdot 0.225 - \left(0.5 + 0.009642857142857142 \cdot {x}^{4}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{\frac{x - \sin x}{x - \tan x}}\right)\\
\end{array}(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
:precision binary64
(if (<= x -0.02731826339141937)
(/ (- x (sin x)) (- x (tan x)))
(if (<= x 0.024311694521294346)
(- (* (* x x) 0.225) (+ 0.5 (* 0.009642857142857142 (pow x 4.0))))
(log (exp (/ (- x (sin x)) (- x (tan x))))))))double code(double x) {
return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
double tmp;
if (x <= -0.02731826339141937) {
tmp = (x - sin(x)) / (x - tan(x));
} else if (x <= 0.024311694521294346) {
tmp = ((x * x) * 0.225) - (0.5 + (0.009642857142857142 * pow(x, 4.0)));
} else {
tmp = log(exp((x - sin(x)) / (x - tan(x))));
}
return tmp;
}



Bits error versus x
Results
if x < -0.027318263391419371Initial program 0.1
if -0.027318263391419371 < x < 0.0243116945212943462Initial program 63.3
Taylor expanded around 0 0.0
Simplified0.0
if 0.0243116945212943462 < x Initial program 0.0
rmApplied add-log-exp_binary640.1
Final simplification0.0
herbie shell --seed 2020358
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))