\[\tan \left(x + \varepsilon\right) - \tan x
\]
↓
\[\begin{array}{l}
t_0 := \tan x + \tan \varepsilon\\
\mathbf{if}\;\varepsilon \leq -3.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{t_0}{1 - \frac{\tan x}{\frac{1}{\tan \varepsilon}}} - \tan x\\
\mathbf{elif}\;\varepsilon \leq 4.5 \cdot 10^{-9}:\\
\;\;\;\;\varepsilon \cdot \left(1 + \frac{0.5 - 0.5 \cdot \cos \left(x \cdot 2\right)}{{\cos x}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{1 - \tan x \cdot \tan \varepsilon} - \tan x\\
\end{array}
\]
(FPCore (x eps) :precision binary64 (- (tan (+ x eps)) (tan x)))
↓
(FPCore (x eps)
:precision binary64
(let* ((t_0 (+ (tan x) (tan eps))))
(if (<= eps -3.5e-9)
(- (/ t_0 (- 1.0 (/ (tan x) (/ 1.0 (tan eps))))) (tan x))
(if (<= eps 4.5e-9)
(* eps (+ 1.0 (/ (- 0.5 (* 0.5 (cos (* x 2.0)))) (pow (cos x) 2.0))))
(- (/ t_0 (- 1.0 (* (tan x) (tan eps)))) (tan x))))))double code(double x, double eps) {
return tan((x + eps)) - tan(x);
}
↓
double code(double x, double eps) {
double t_0 = tan(x) + tan(eps);
double tmp;
if (eps <= -3.5e-9) {
tmp = (t_0 / (1.0 - (tan(x) / (1.0 / tan(eps))))) - tan(x);
} else if (eps <= 4.5e-9) {
tmp = eps * (1.0 + ((0.5 - (0.5 * cos((x * 2.0)))) / pow(cos(x), 2.0)));
} else {
tmp = (t_0 / (1.0 - (tan(x) * tan(eps)))) - tan(x);
}
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 = tan(x) + tan(eps)
if (eps <= (-3.5d-9)) then
tmp = (t_0 / (1.0d0 - (tan(x) / (1.0d0 / tan(eps))))) - tan(x)
else if (eps <= 4.5d-9) then
tmp = eps * (1.0d0 + ((0.5d0 - (0.5d0 * cos((x * 2.0d0)))) / (cos(x) ** 2.0d0)))
else
tmp = (t_0 / (1.0d0 - (tan(x) * tan(eps)))) - tan(x)
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.tan(x) + Math.tan(eps);
double tmp;
if (eps <= -3.5e-9) {
tmp = (t_0 / (1.0 - (Math.tan(x) / (1.0 / Math.tan(eps))))) - Math.tan(x);
} else if (eps <= 4.5e-9) {
tmp = eps * (1.0 + ((0.5 - (0.5 * Math.cos((x * 2.0)))) / Math.pow(Math.cos(x), 2.0)));
} else {
tmp = (t_0 / (1.0 - (Math.tan(x) * Math.tan(eps)))) - Math.tan(x);
}
return tmp;
}
def code(x, eps):
return math.tan((x + eps)) - math.tan(x)
↓
def code(x, eps):
t_0 = math.tan(x) + math.tan(eps)
tmp = 0
if eps <= -3.5e-9:
tmp = (t_0 / (1.0 - (math.tan(x) / (1.0 / math.tan(eps))))) - math.tan(x)
elif eps <= 4.5e-9:
tmp = eps * (1.0 + ((0.5 - (0.5 * math.cos((x * 2.0)))) / math.pow(math.cos(x), 2.0)))
else:
tmp = (t_0 / (1.0 - (math.tan(x) * math.tan(eps)))) - math.tan(x)
return tmp
function code(x, eps)
return Float64(tan(Float64(x + eps)) - tan(x))
end
↓
function code(x, eps)
t_0 = Float64(tan(x) + tan(eps))
tmp = 0.0
if (eps <= -3.5e-9)
tmp = Float64(Float64(t_0 / Float64(1.0 - Float64(tan(x) / Float64(1.0 / tan(eps))))) - tan(x));
elseif (eps <= 4.5e-9)
tmp = Float64(eps * Float64(1.0 + Float64(Float64(0.5 - Float64(0.5 * cos(Float64(x * 2.0)))) / (cos(x) ^ 2.0))));
else
tmp = Float64(Float64(t_0 / Float64(1.0 - Float64(tan(x) * tan(eps)))) - tan(x));
end
return tmp
end
function tmp = code(x, eps)
tmp = tan((x + eps)) - tan(x);
end
↓
function tmp_2 = code(x, eps)
t_0 = tan(x) + tan(eps);
tmp = 0.0;
if (eps <= -3.5e-9)
tmp = (t_0 / (1.0 - (tan(x) / (1.0 / tan(eps))))) - tan(x);
elseif (eps <= 4.5e-9)
tmp = eps * (1.0 + ((0.5 - (0.5 * cos((x * 2.0)))) / (cos(x) ^ 2.0)));
else
tmp = (t_0 / (1.0 - (tan(x) * tan(eps)))) - tan(x);
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[Tan[x], $MachinePrecision] + N[Tan[eps], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps, -3.5e-9], N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[x], $MachinePrecision] / N[(1.0 / N[Tan[eps], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[eps, 4.5e-9], N[(eps * N[(1.0 + N[(N[(0.5 - N[(0.5 * N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[Cos[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[x], $MachinePrecision] * N[Tan[eps], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[x], $MachinePrecision]), $MachinePrecision]]]]
\tan \left(x + \varepsilon\right) - \tan x
↓
\begin{array}{l}
t_0 := \tan x + \tan \varepsilon\\
\mathbf{if}\;\varepsilon \leq -3.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{t_0}{1 - \frac{\tan x}{\frac{1}{\tan \varepsilon}}} - \tan x\\
\mathbf{elif}\;\varepsilon \leq 4.5 \cdot 10^{-9}:\\
\;\;\;\;\varepsilon \cdot \left(1 + \frac{0.5 - 0.5 \cdot \cos \left(x \cdot 2\right)}{{\cos x}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{1 - \tan x \cdot \tan \varepsilon} - \tan x\\
\end{array}