(FPCore (x) :precision binary64 (/ (- x (sin x)) (- x (tan x))))
(FPCore (x)
:precision binary64
(let* ((t_0 (cbrt (tan x)))
(t_1 (/ (- (sin x) x) (fma (pow t_0 2.0) t_0 (- x)))))
(if (<= x -0.08068580892332364)
t_1
(if (<= x 0.018354480817908324)
(fma
x
(* x 0.225)
(fma
-0.009642857142857142
(pow x 4.0)
(fma 0.00024107142857142857 (pow x 6.0) -0.5)))
t_1))))double code(double x) {
return (x - sin(x)) / (x - tan(x));
}
double code(double x) {
double t_0 = cbrt(tan(x));
double t_1 = (sin(x) - x) / fma(pow(t_0, 2.0), t_0, -x);
double tmp;
if (x <= -0.08068580892332364) {
tmp = t_1;
} else if (x <= 0.018354480817908324) {
tmp = fma(x, (x * 0.225), fma(-0.009642857142857142, pow(x, 4.0), fma(0.00024107142857142857, pow(x, 6.0), -0.5)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x) return Float64(Float64(x - sin(x)) / Float64(x - tan(x))) end
function code(x) t_0 = cbrt(tan(x)) t_1 = Float64(Float64(sin(x) - x) / fma((t_0 ^ 2.0), t_0, Float64(-x))) tmp = 0.0 if (x <= -0.08068580892332364) tmp = t_1; elseif (x <= 0.018354480817908324) tmp = fma(x, Float64(x * 0.225), fma(-0.009642857142857142, (x ^ 4.0), fma(0.00024107142857142857, (x ^ 6.0), -0.5))); else tmp = t_1; 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[Power[N[Tan[x], $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sin[x], $MachinePrecision] - x), $MachinePrecision] / N[(N[Power[t$95$0, 2.0], $MachinePrecision] * t$95$0 + (-x)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.08068580892332364], t$95$1, If[LessEqual[x, 0.018354480817908324], N[(x * N[(x * 0.225), $MachinePrecision] + N[(-0.009642857142857142 * N[Power[x, 4.0], $MachinePrecision] + N[(0.00024107142857142857 * N[Power[x, 6.0], $MachinePrecision] + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
t_0 := \sqrt[3]{\tan x}\\
t_1 := \frac{\sin x - x}{\mathsf{fma}\left({t_0}^{2}, t_0, -x\right)}\\
\mathbf{if}\;x \leq -0.08068580892332364:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 0.018354480817908324:\\
\;\;\;\;\mathsf{fma}\left(x, x \cdot 0.225, \mathsf{fma}\left(-0.009642857142857142, {x}^{4}, \mathsf{fma}\left(0.00024107142857142857, {x}^{6}, -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
if x < -0.080685808923323638 or 0.018354480817908324 < x Initial program 0.1
Simplified0.1
Applied egg-rr0.1
if -0.080685808923323638 < x < 0.018354480817908324Initial program 63.0
Simplified63.0
Taylor expanded in x around 0 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2022210
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))