\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
t_0 := x - \tan x\\
t_1 := \frac{x}{t_0}\\
\mathbf{if}\;x \leq -0.09789578775807517:\\
\;\;\;\;\begin{array}{l}
t_2 := \sqrt[3]{t_1 - \frac{\sin x}{t_0}}\\
t_3 := \mathsf{fma}\left(-\frac{\sin x}{\sqrt[3]{t_0}}, \frac{1}{\sqrt[3]{t_0} \cdot \sqrt[3]{t_0}}, \frac{\sin x}{\sqrt[3]{t_0}} \cdot \frac{1}{\sqrt[3]{t_0} \cdot \sqrt[3]{t_0}}\right)\\
t_4 := \frac{\sin x}{\sqrt[3]{t_0}}\\
t_5 := \sqrt[3]{t_0}\\
t_6 := \frac{1}{t_5 \cdot t_5}\\
t_7 := t_5 \cdot t_5\\
t_3 + t_2 \cdot \left(t_2 \cdot \sqrt[3]{\mathsf{fma}\left(1, t_1, t_4 \cdot \frac{-1}{t_7}\right) + t_3}\right)
\end{array}\\
\mathbf{elif}\;x \leq 0.09493097848297538:\\
\;\;\;\;\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}:\\
\;\;\;\;\begin{array}{l}
t_8 := \frac{-1}{t_0}\\
\mathsf{fma}\left(1, t_1, \sin x \cdot t_8\right) + \mathsf{fma}\left(t_8, \sin x, \sin x \cdot \frac{1}{t_0}\right)
\end{array}\\
\end{array}
(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
:precision binary64
(let* ((t_0 (- x (tan x))) (t_1 (/ x t_0)))
(if (<= x -0.09789578775807517)
(let* ((t_2 (cbrt (- t_1 (/ (sin x) t_0))))
(t_3
(fma
(- (/ (sin x) (cbrt t_0)))
(/ 1.0 (* (cbrt t_0) (cbrt t_0)))
(* (/ (sin x) (cbrt t_0)) (/ 1.0 (* (cbrt t_0) (cbrt t_0))))))
(t_4 (/ (sin x) (cbrt t_0)))
(t_5 (cbrt t_0))
(t_6 (/ 1.0 (* t_5 t_5)))
(t_7 (* t_5 t_5)))
(+
t_3
(* t_2 (* t_2 (cbrt (+ (fma 1.0 t_1 (* t_4 (/ -1.0 t_7))) t_3))))))
(if (<= x 0.09493097848297538)
(-
(fma 0.225 (* x x) (* 0.00024107142857142857 (pow x 6.0)))
(fma 0.009642857142857142 (pow x 4.0) 0.5))
(let* ((t_8 (/ -1.0 t_0)))
(+
(fma 1.0 t_1 (* (sin x) t_8))
(fma t_8 (sin x) (* (sin x) (/ 1.0 t_0)))))))))double code(double x) {
return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
double t_0 = x - tan(x);
double t_1 = x / t_0;
double tmp;
if (x <= -0.09789578775807517) {
double t_2_1 = cbrt(t_1 - (sin(x) / t_0));
double t_3_2 = fma(-(sin(x) / cbrt(t_0)), (1.0 / (cbrt(t_0) * cbrt(t_0))), ((sin(x) / cbrt(t_0)) * (1.0 / (cbrt(t_0) * cbrt(t_0)))));
double t_4_3 = sin(x) / cbrt(t_0);
double t_5_4 = cbrt(t_0);
double t_6_5 = 1.0 / (t_5_4 * t_5_4);
double t_7_6 = t_5_4 * t_5_4;
tmp = t_3_2 + (t_2_1 * (t_2_1 * cbrt(fma(1.0, t_1, (t_4_3 * (-1.0 / t_7_6))) + t_3_2)));
} else if (x <= 0.09493097848297538) {
tmp = fma(0.225, (x * x), (0.00024107142857142857 * pow(x, 6.0))) - fma(0.009642857142857142, pow(x, 4.0), 0.5);
} else {
double t_8 = -1.0 / t_0;
tmp = fma(1.0, t_1, (sin(x) * t_8)) + fma(t_8, sin(x), (sin(x) * (1.0 / t_0)));
}
return tmp;
}



Bits error versus x
if x < -0.09789578775807517Initial program 0.0
Applied div-sub_binary640.0
Applied add-cube-cbrt_binary640.0
Applied *-un-lft-identity_binary640.0
Applied times-frac_binary640.0
Applied *-un-lft-identity_binary640.0
Applied prod-diff_binary640.0
Applied add-cube-cbrt_binary640.1
Simplified0.1
Simplified0.1
Applied add-cube-cbrt_binary640.1
Applied *-un-lft-identity_binary640.1
Applied times-frac_binary640.1
Applied *-un-lft-identity_binary640.1
Applied prod-diff_binary640.1
if -0.09789578775807517 < x < 0.094930978482975381Initial program 63.0
Taylor expanded in x around 0 0.0
Simplified0.0
if 0.094930978482975381 < x Initial program 0.0
Applied div-sub_binary640.0
Applied div-inv_binary640.0
Applied *-un-lft-identity_binary640.0
Applied *-un-lft-identity_binary640.0
Applied times-frac_binary640.0
Applied prod-diff_binary640.0
Final simplification0.0
herbie shell --seed 2022077
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))