(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) (/ (sin x) t_0))))
(if (<= x -12.952388770360225)
t_1
(if (<= x 2.0288157605164016e-8)
(+
(+
(* 0.225 (pow x 2.0))
(log
(exp
(fma
-0.009642857142857142
(pow x 4.0)
(* 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 = x - tan(x);
double t_1 = (x / t_0) - (sin(x) / t_0);
double tmp;
if (x <= -12.952388770360225) {
tmp = t_1;
} else if (x <= 2.0288157605164016e-8) {
tmp = ((0.225 * pow(x, 2.0)) + log(exp(fma(-0.009642857142857142, pow(x, 4.0), (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 = Float64(x - tan(x)) t_1 = Float64(Float64(x / t_0) - Float64(sin(x) / t_0)) tmp = 0.0 if (x <= -12.952388770360225) tmp = t_1; elseif (x <= 2.0288157605164016e-8) tmp = Float64(Float64(Float64(0.225 * (x ^ 2.0)) + log(exp(fma(-0.009642857142857142, (x ^ 4.0), Float64(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[(x - N[Tan[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x / t$95$0), $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -12.952388770360225], t$95$1, If[LessEqual[x, 2.0288157605164016e-8], N[(N[(N[(0.225 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] + N[Log[N[Exp[N[(-0.009642857142857142 * N[Power[x, 4.0], $MachinePrecision] + N[(0.00024107142857142857 * N[Power[x, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + -0.5), $MachinePrecision], t$95$1]]]]
\frac{x - \sin x}{x - \tan x}
\begin{array}{l}
t_0 := x - \tan x\\
t_1 := \frac{x}{t_0} - \frac{\sin x}{t_0}\\
\mathbf{if}\;x \leq -12.952388770360225:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.0288157605164016 \cdot 10^{-8}:\\
\;\;\;\;\left(0.225 \cdot {x}^{2} + \log \left(e^{\mathsf{fma}\left(-0.009642857142857142, {x}^{4}, 0.00024107142857142857 \cdot {x}^{6}\right)}\right)\right) + -0.5\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
if x < -12.9523887703602245 or 2.0288157605164016e-8 < x Initial program 0.3
Applied egg-rr0.2
if -12.9523887703602245 < x < 2.0288157605164016e-8Initial program 63.3
Taylor expanded in x around 0 0.1
Applied egg-rr0.1
Final simplification0.2
herbie shell --seed 2022192
(FPCore (x)
:name "sintan (problem 3.4.5)"
:precision binary64
(/ (- x (sin x)) (- x (tan x))))