\[\tan \left(x + \varepsilon\right) - \tan x
\]
↓
\[\begin{array}{l}
t_0 := \frac{\sin \varepsilon}{\cos \varepsilon}\\
t_1 := {\sin x}^{2}\\
t_2 := {\cos x}^{2}\\
t_3 := \frac{t_1}{t_2}\\
t_4 := 0.16666666666666666 \cdot t_3\\
t_5 := t_3 - -1\\
t_6 := -\frac{t_1 \cdot t_5}{t_2}\\
t_7 := -0.5 \cdot t_5\\
\mathbf{if}\;\varepsilon \leq -0.265:\\
\;\;\;\;t_0 - \tan x\\
\mathbf{elif}\;\varepsilon \leq 0.0048:\\
\;\;\;\;\varepsilon \cdot t_5 + \left({\varepsilon}^{3} \cdot \left(-0.16666666666666666 - \left(t_4 + \left(t_6 + t_7\right)\right)\right) + \left(\frac{t_5 \cdot \left(\sin x \cdot {\varepsilon}^{2}\right)}{\cos x} + \left(\frac{\sin x \cdot \left(t_6 + \left(t_4 + \left(0.16666666666666666 + t_7\right)\right)\right)}{\cos x} + \frac{\sin x \cdot t_5}{\cos x} \cdot -0.3333333333333333\right) \cdot \left(-{\varepsilon}^{4}\right)\right)\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) (cos eps)))
(t_1 (pow (sin x) 2.0))
(t_2 (pow (cos x) 2.0))
(t_3 (/ t_1 t_2))
(t_4 (* 0.16666666666666666 t_3))
(t_5 (- t_3 -1.0))
(t_6 (- (/ (* t_1 t_5) t_2)))
(t_7 (* -0.5 t_5)))
(if (<= eps -0.265)
(- t_0 (tan x))
(if (<= eps 0.0048)
(+
(* eps t_5)
(+
(* (pow eps 3.0) (- -0.16666666666666666 (+ t_4 (+ t_6 t_7))))
(+
(/ (* t_5 (* (sin x) (pow eps 2.0))) (cos x))
(*
(+
(/ (* (sin x) (+ t_6 (+ t_4 (+ 0.16666666666666666 t_7)))) (cos x))
(* (/ (* (sin x) t_5) (cos x)) -0.3333333333333333))
(- (pow eps 4.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) / cos(eps);
double t_1 = pow(sin(x), 2.0);
double t_2 = pow(cos(x), 2.0);
double t_3 = t_1 / t_2;
double t_4 = 0.16666666666666666 * t_3;
double t_5 = t_3 - -1.0;
double t_6 = -((t_1 * t_5) / t_2);
double t_7 = -0.5 * t_5;
double tmp;
if (eps <= -0.265) {
tmp = t_0 - tan(x);
} else if (eps <= 0.0048) {
tmp = (eps * t_5) + ((pow(eps, 3.0) * (-0.16666666666666666 - (t_4 + (t_6 + t_7)))) + (((t_5 * (sin(x) * pow(eps, 2.0))) / cos(x)) + ((((sin(x) * (t_6 + (t_4 + (0.16666666666666666 + t_7)))) / cos(x)) + (((sin(x) * t_5) / cos(x)) * -0.3333333333333333)) * -pow(eps, 4.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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_0 = sin(eps) / cos(eps)
t_1 = sin(x) ** 2.0d0
t_2 = cos(x) ** 2.0d0
t_3 = t_1 / t_2
t_4 = 0.16666666666666666d0 * t_3
t_5 = t_3 - (-1.0d0)
t_6 = -((t_1 * t_5) / t_2)
t_7 = (-0.5d0) * t_5
if (eps <= (-0.265d0)) then
tmp = t_0 - tan(x)
else if (eps <= 0.0048d0) then
tmp = (eps * t_5) + (((eps ** 3.0d0) * ((-0.16666666666666666d0) - (t_4 + (t_6 + t_7)))) + (((t_5 * (sin(x) * (eps ** 2.0d0))) / cos(x)) + ((((sin(x) * (t_6 + (t_4 + (0.16666666666666666d0 + t_7)))) / cos(x)) + (((sin(x) * t_5) / cos(x)) * (-0.3333333333333333d0))) * -(eps ** 4.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) / Math.cos(eps);
double t_1 = Math.pow(Math.sin(x), 2.0);
double t_2 = Math.pow(Math.cos(x), 2.0);
double t_3 = t_1 / t_2;
double t_4 = 0.16666666666666666 * t_3;
double t_5 = t_3 - -1.0;
double t_6 = -((t_1 * t_5) / t_2);
double t_7 = -0.5 * t_5;
double tmp;
if (eps <= -0.265) {
tmp = t_0 - Math.tan(x);
} else if (eps <= 0.0048) {
tmp = (eps * t_5) + ((Math.pow(eps, 3.0) * (-0.16666666666666666 - (t_4 + (t_6 + t_7)))) + (((t_5 * (Math.sin(x) * Math.pow(eps, 2.0))) / Math.cos(x)) + ((((Math.sin(x) * (t_6 + (t_4 + (0.16666666666666666 + t_7)))) / Math.cos(x)) + (((Math.sin(x) * t_5) / Math.cos(x)) * -0.3333333333333333)) * -Math.pow(eps, 4.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) / math.cos(eps)
t_1 = math.pow(math.sin(x), 2.0)
t_2 = math.pow(math.cos(x), 2.0)
t_3 = t_1 / t_2
t_4 = 0.16666666666666666 * t_3
t_5 = t_3 - -1.0
t_6 = -((t_1 * t_5) / t_2)
t_7 = -0.5 * t_5
tmp = 0
if eps <= -0.265:
tmp = t_0 - math.tan(x)
elif eps <= 0.0048:
tmp = (eps * t_5) + ((math.pow(eps, 3.0) * (-0.16666666666666666 - (t_4 + (t_6 + t_7)))) + (((t_5 * (math.sin(x) * math.pow(eps, 2.0))) / math.cos(x)) + ((((math.sin(x) * (t_6 + (t_4 + (0.16666666666666666 + t_7)))) / math.cos(x)) + (((math.sin(x) * t_5) / math.cos(x)) * -0.3333333333333333)) * -math.pow(eps, 4.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(sin(eps) / cos(eps))
t_1 = sin(x) ^ 2.0
t_2 = cos(x) ^ 2.0
t_3 = Float64(t_1 / t_2)
t_4 = Float64(0.16666666666666666 * t_3)
t_5 = Float64(t_3 - -1.0)
t_6 = Float64(-Float64(Float64(t_1 * t_5) / t_2))
t_7 = Float64(-0.5 * t_5)
tmp = 0.0
if (eps <= -0.265)
tmp = Float64(t_0 - tan(x));
elseif (eps <= 0.0048)
tmp = Float64(Float64(eps * t_5) + Float64(Float64((eps ^ 3.0) * Float64(-0.16666666666666666 - Float64(t_4 + Float64(t_6 + t_7)))) + Float64(Float64(Float64(t_5 * Float64(sin(x) * (eps ^ 2.0))) / cos(x)) + Float64(Float64(Float64(Float64(sin(x) * Float64(t_6 + Float64(t_4 + Float64(0.16666666666666666 + t_7)))) / cos(x)) + Float64(Float64(Float64(sin(x) * t_5) / cos(x)) * -0.3333333333333333)) * Float64(-(eps ^ 4.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) / cos(eps);
t_1 = sin(x) ^ 2.0;
t_2 = cos(x) ^ 2.0;
t_3 = t_1 / t_2;
t_4 = 0.16666666666666666 * t_3;
t_5 = t_3 - -1.0;
t_6 = -((t_1 * t_5) / t_2);
t_7 = -0.5 * t_5;
tmp = 0.0;
if (eps <= -0.265)
tmp = t_0 - tan(x);
elseif (eps <= 0.0048)
tmp = (eps * t_5) + (((eps ^ 3.0) * (-0.16666666666666666 - (t_4 + (t_6 + t_7)))) + (((t_5 * (sin(x) * (eps ^ 2.0))) / cos(x)) + ((((sin(x) * (t_6 + (t_4 + (0.16666666666666666 + t_7)))) / cos(x)) + (((sin(x) * t_5) / cos(x)) * -0.3333333333333333)) * -(eps ^ 4.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[Sin[eps], $MachinePrecision] / N[Cos[eps], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Cos[x], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(0.16666666666666666 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 - -1.0), $MachinePrecision]}, Block[{t$95$6 = (-N[(N[(t$95$1 * t$95$5), $MachinePrecision] / t$95$2), $MachinePrecision])}, Block[{t$95$7 = N[(-0.5 * t$95$5), $MachinePrecision]}, If[LessEqual[eps, -0.265], N[(t$95$0 - N[Tan[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[eps, 0.0048], N[(N[(eps * t$95$5), $MachinePrecision] + N[(N[(N[Power[eps, 3.0], $MachinePrecision] * N[(-0.16666666666666666 - N[(t$95$4 + N[(t$95$6 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$5 * N[(N[Sin[x], $MachinePrecision] * N[Power[eps, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[Sin[x], $MachinePrecision] * N[(t$95$6 + N[(t$95$4 + N[(0.16666666666666666 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Sin[x], $MachinePrecision] * t$95$5), $MachinePrecision] / N[Cos[x], $MachinePrecision]), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]), $MachinePrecision] * (-N[Power[eps, 4.0], $MachinePrecision])), $MachinePrecision]), $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 := {\sin x}^{2}\\
t_2 := {\cos x}^{2}\\
t_3 := \frac{t_1}{t_2}\\
t_4 := 0.16666666666666666 \cdot t_3\\
t_5 := t_3 - -1\\
t_6 := -\frac{t_1 \cdot t_5}{t_2}\\
t_7 := -0.5 \cdot t_5\\
\mathbf{if}\;\varepsilon \leq -0.265:\\
\;\;\;\;t_0 - \tan x\\
\mathbf{elif}\;\varepsilon \leq 0.0048:\\
\;\;\;\;\varepsilon \cdot t_5 + \left({\varepsilon}^{3} \cdot \left(-0.16666666666666666 - \left(t_4 + \left(t_6 + t_7\right)\right)\right) + \left(\frac{t_5 \cdot \left(\sin x \cdot {\varepsilon}^{2}\right)}{\cos x} + \left(\frac{\sin x \cdot \left(t_6 + \left(t_4 + \left(0.16666666666666666 + t_7\right)\right)\right)}{\cos x} + \frac{\sin x \cdot t_5}{\cos x} \cdot -0.3333333333333333\right) \cdot \left(-{\varepsilon}^{4}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}