(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
:precision binary64
(let* ((t_0 (- x (tan x))))
(if (<= x -2.646218411575844)
(fma -1.0 (/ (sin x) x) (+ (/ (tan x) x) 1.0))
(if (<= x 0.02855440944818922)
(fma 0.225 (* x x) (fma (pow x 4.0) -0.009642857142857142 -0.5))
(- (/ x t_0) (/ (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 <= -2.646218411575844) {
tmp = fma(-1.0, (sin(x) / x), ((tan(x) / x) + 1.0));
} else if (x <= 0.02855440944818922) {
tmp = fma(0.225, (x * x), fma(pow(x, 4.0), -0.009642857142857142, -0.5));
} else {
tmp = (x / t_0) - (sin(x) / t_0);
}
return tmp;
}
function code(x) return Float64(Float64(x - sin(x)) / Float64(x - tan(x))) end
function code(x) t_0 = Float64(x - tan(x)) tmp = 0.0 if (x <= -2.646218411575844) tmp = fma(-1.0, Float64(sin(x) / x), Float64(Float64(tan(x) / x) + 1.0)); elseif (x <= 0.02855440944818922) tmp = fma(0.225, Float64(x * x), fma((x ^ 4.0), -0.009642857142857142, -0.5)); else tmp = Float64(Float64(x / t_0) - Float64(sin(x) / t_0)); end return tmp end
code[x_] := N[(N[(x - N[Sin[x], $MachinePrecision]), $MachinePrecision] / N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.646218411575844], N[(-1.0 * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[Tan[x], $MachinePrecision] / x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.02855440944818922], N[(0.225 * N[(x * x), $MachinePrecision] + N[(N[Power[x, 4.0], $MachinePrecision] * -0.009642857142857142 + -0.5), $MachinePrecision]), $MachinePrecision], N[(N[(x / t$95$0), $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
t_0 := x - \tan x\\
\mathbf{if}\;x \leq -2.646218411575844:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{\sin x}{x}, \frac{\tan x}{x} + 1\right)\\
\mathbf{elif}\;x \leq 0.02855440944818922:\\
\;\;\;\;\mathsf{fma}\left(0.225, x \cdot x, \mathsf{fma}\left({x}^{4}, -0.009642857142857142, -0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t_0} - \frac{\sin x}{t_0}\\
\end{array}



Bits error versus x
if x < -2.6462184115758438Initial program 0.0
Taylor expanded in x around inf 0.7
Applied egg-rr0.7
if -2.6462184115758438 < x < 0.0285544094481892212Initial program 63.2
Applied egg-rr63.2
Taylor expanded in x around 0 0.1
Simplified0.1
if 0.0285544094481892212 < x Initial program 0.1
Applied egg-rr0.1
Final simplification0.2
herbie shell --seed 2022153
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))