\[\tan \left(x + \varepsilon\right) - \tan x
\]
↓
\[\begin{array}{l}
t_0 := \frac{\sin \varepsilon}{\cos \varepsilon}\\
t_1 := 1 + \frac{{\sin x}^{2}}{{\cos x}^{2}}\\
\mathbf{if}\;\varepsilon \leq -0.00025:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\varepsilon \leq 2.8 \cdot 10^{-13}:\\
\;\;\;\;\varepsilon \cdot t_1 + \frac{{\varepsilon}^{2} \cdot \left(t_1 \cdot \sin x\right)}{\cos x}\\
\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) (cos eps)))
(t_1 (+ 1.0 (/ (pow (sin x) 2.0) (pow (cos x) 2.0)))))
(if (<= eps -0.00025)
t_0
(if (<= eps 2.8e-13)
(+ (* eps t_1) (/ (* (pow eps 2.0) (* t_1 (sin x))) (cos x)))
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) / cos(eps);
double t_1 = 1.0 + (pow(sin(x), 2.0) / pow(cos(x), 2.0));
double tmp;
if (eps <= -0.00025) {
tmp = t_0;
} else if (eps <= 2.8e-13) {
tmp = (eps * t_1) + ((pow(eps, 2.0) * (t_1 * sin(x))) / cos(x));
} 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) :: t_1
real(8) :: tmp
t_0 = sin(eps) / cos(eps)
t_1 = 1.0d0 + ((sin(x) ** 2.0d0) / (cos(x) ** 2.0d0))
if (eps <= (-0.00025d0)) then
tmp = t_0
else if (eps <= 2.8d-13) then
tmp = (eps * t_1) + (((eps ** 2.0d0) * (t_1 * sin(x))) / cos(x))
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) / Math.cos(eps);
double t_1 = 1.0 + (Math.pow(Math.sin(x), 2.0) / Math.pow(Math.cos(x), 2.0));
double tmp;
if (eps <= -0.00025) {
tmp = t_0;
} else if (eps <= 2.8e-13) {
tmp = (eps * t_1) + ((Math.pow(eps, 2.0) * (t_1 * Math.sin(x))) / Math.cos(x));
} 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) / math.cos(eps)
t_1 = 1.0 + (math.pow(math.sin(x), 2.0) / math.pow(math.cos(x), 2.0))
tmp = 0
if eps <= -0.00025:
tmp = t_0
elif eps <= 2.8e-13:
tmp = (eps * t_1) + ((math.pow(eps, 2.0) * (t_1 * math.sin(x))) / math.cos(x))
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(sin(eps) / cos(eps))
t_1 = Float64(1.0 + Float64((sin(x) ^ 2.0) / (cos(x) ^ 2.0)))
tmp = 0.0
if (eps <= -0.00025)
tmp = t_0;
elseif (eps <= 2.8e-13)
tmp = Float64(Float64(eps * t_1) + Float64(Float64((eps ^ 2.0) * Float64(t_1 * sin(x))) / cos(x)));
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) / cos(eps);
t_1 = 1.0 + ((sin(x) ^ 2.0) / (cos(x) ^ 2.0));
tmp = 0.0;
if (eps <= -0.00025)
tmp = t_0;
elseif (eps <= 2.8e-13)
tmp = (eps * t_1) + (((eps ^ 2.0) * (t_1 * sin(x))) / cos(x));
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[Sin[eps], $MachinePrecision] / N[Cos[eps], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[N[Cos[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps, -0.00025], t$95$0, If[LessEqual[eps, 2.8e-13], N[(N[(eps * t$95$1), $MachinePrecision] + N[(N[(N[Power[eps, 2.0], $MachinePrecision] * N[(t$95$1 * N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\tan \left(x + \varepsilon\right) - \tan x
↓
\begin{array}{l}
t_0 := \frac{\sin \varepsilon}{\cos \varepsilon}\\
t_1 := 1 + \frac{{\sin x}^{2}}{{\cos x}^{2}}\\
\mathbf{if}\;\varepsilon \leq -0.00025:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\varepsilon \leq 2.8 \cdot 10^{-13}:\\
\;\;\;\;\varepsilon \cdot t_1 + \frac{{\varepsilon}^{2} \cdot \left(t_1 \cdot \sin x\right)}{\cos x}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}