\[\tan \left(x + \varepsilon\right) - \tan x
\]
↓
\[\begin{array}{l}
t_0 := \frac{\sin \left(\varepsilon + x\right)}{\cos \varepsilon + \left(x \cdot \left(-\sin \varepsilon\right) + \cos \varepsilon \cdot \left(-0.5 \cdot {x}^{2}\right)\right)} - \frac{\sin x}{\cos x}\\
\mathbf{if}\;\varepsilon \leq -0.0006:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\varepsilon \leq 1.3 \cdot 10^{-7}:\\
\;\;\;\;-\varepsilon \cdot \left(-1 - \frac{{\sin x}^{2}}{{\cos x}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
(FPCore (x eps) :precision binary64 (- (tan (+ x eps)) (tan x)))
↓
(FPCore (x eps)
:precision binary64
(let* ((t_0
(-
(/
(sin (+ eps x))
(+
(cos eps)
(+ (* x (- (sin eps))) (* (cos eps) (* -0.5 (pow x 2.0))))))
(/ (sin x) (cos x)))))
(if (<= eps -0.0006)
t_0
(if (<= eps 1.3e-7)
(- (* eps (- -1.0 (/ (pow (sin x) 2.0) (pow (cos x) 2.0)))))
t_0))))double code(double x, double eps) {
return tan((x + eps)) - tan(x);
}
↓
double code(double x, double eps) {
double t_0 = (sin((eps + x)) / (cos(eps) + ((x * -sin(eps)) + (cos(eps) * (-0.5 * pow(x, 2.0)))))) - (sin(x) / cos(x));
double tmp;
if (eps <= -0.0006) {
tmp = t_0;
} else if (eps <= 1.3e-7) {
tmp = -(eps * (-1.0 - (pow(sin(x), 2.0) / pow(cos(x), 2.0))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = tan((x + eps)) - tan(x)
end function
↓
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = (sin((eps + x)) / (cos(eps) + ((x * -sin(eps)) + (cos(eps) * ((-0.5d0) * (x ** 2.0d0)))))) - (sin(x) / cos(x))
if (eps <= (-0.0006d0)) then
tmp = t_0
else if (eps <= 1.3d-7) then
tmp = -(eps * ((-1.0d0) - ((sin(x) ** 2.0d0) / (cos(x) ** 2.0d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
return Math.tan((x + eps)) - Math.tan(x);
}
↓
public static double code(double x, double eps) {
double t_0 = (Math.sin((eps + x)) / (Math.cos(eps) + ((x * -Math.sin(eps)) + (Math.cos(eps) * (-0.5 * Math.pow(x, 2.0)))))) - (Math.sin(x) / Math.cos(x));
double tmp;
if (eps <= -0.0006) {
tmp = t_0;
} else if (eps <= 1.3e-7) {
tmp = -(eps * (-1.0 - (Math.pow(Math.sin(x), 2.0) / Math.pow(Math.cos(x), 2.0))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps):
return math.tan((x + eps)) - math.tan(x)
↓
def code(x, eps):
t_0 = (math.sin((eps + x)) / (math.cos(eps) + ((x * -math.sin(eps)) + (math.cos(eps) * (-0.5 * math.pow(x, 2.0)))))) - (math.sin(x) / math.cos(x))
tmp = 0
if eps <= -0.0006:
tmp = t_0
elif eps <= 1.3e-7:
tmp = -(eps * (-1.0 - (math.pow(math.sin(x), 2.0) / math.pow(math.cos(x), 2.0))))
else:
tmp = t_0
return tmp
function code(x, eps)
return Float64(tan(Float64(x + eps)) - tan(x))
end
↓
function code(x, eps)
t_0 = Float64(Float64(sin(Float64(eps + x)) / Float64(cos(eps) + Float64(Float64(x * Float64(-sin(eps))) + Float64(cos(eps) * Float64(-0.5 * (x ^ 2.0)))))) - Float64(sin(x) / cos(x)))
tmp = 0.0
if (eps <= -0.0006)
tmp = t_0;
elseif (eps <= 1.3e-7)
tmp = Float64(-Float64(eps * Float64(-1.0 - Float64((sin(x) ^ 2.0) / (cos(x) ^ 2.0)))));
else
tmp = t_0;
end
return tmp
end
function tmp = code(x, eps)
tmp = tan((x + eps)) - tan(x);
end
↓
function tmp_2 = code(x, eps)
t_0 = (sin((eps + x)) / (cos(eps) + ((x * -sin(eps)) + (cos(eps) * (-0.5 * (x ^ 2.0)))))) - (sin(x) / cos(x));
tmp = 0.0;
if (eps <= -0.0006)
tmp = t_0;
elseif (eps <= 1.3e-7)
tmp = -(eps * (-1.0 - ((sin(x) ^ 2.0) / (cos(x) ^ 2.0))));
else
tmp = t_0;
end
tmp_2 = tmp;
end
code[x_, eps_] := N[(N[Tan[N[(x + eps), $MachinePrecision]], $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision]
↓
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[Sin[N[(eps + x), $MachinePrecision]], $MachinePrecision] / N[(N[Cos[eps], $MachinePrecision] + N[(N[(x * (-N[Sin[eps], $MachinePrecision])), $MachinePrecision] + N[(N[Cos[eps], $MachinePrecision] * N[(-0.5 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sin[x], $MachinePrecision] / N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps, -0.0006], t$95$0, If[LessEqual[eps, 1.3e-7], (-N[(eps * N[(-1.0 - N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[N[Cos[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), t$95$0]]]
\tan \left(x + \varepsilon\right) - \tan x
↓
\begin{array}{l}
t_0 := \frac{\sin \left(\varepsilon + x\right)}{\cos \varepsilon + \left(x \cdot \left(-\sin \varepsilon\right) + \cos \varepsilon \cdot \left(-0.5 \cdot {x}^{2}\right)\right)} - \frac{\sin x}{\cos x}\\
\mathbf{if}\;\varepsilon \leq -0.0006:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\varepsilon \leq 1.3 \cdot 10^{-7}:\\
\;\;\;\;-\varepsilon \cdot \left(-1 - \frac{{\sin x}^{2}}{{\cos x}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}