\[\frac{1 - \cos x}{\sin x}
\]
↓
\[\begin{array}{l}
t_0 := 1 - \cos x\\
t_1 := \frac{t_0}{\sin x}\\
\mathbf{if}\;t_1 \leq -0.003:\\
\;\;\;\;\frac{t_0 \cdot \left(\frac{1}{t_0} \cdot t_0\right)}{\sin x}\\
\mathbf{elif}\;t_1 \leq 0.02:\\
\;\;\;\;0.5 \cdot x + \left(0.041666666666666664 \cdot {x}^{3} + \left(0.004166666666666667 \cdot {x}^{5} + 0.00042162698412698415 \cdot {x}^{7}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
(FPCore (x) :precision binary64 (/ (- 1.0 (cos x)) (sin x)))
↓
(FPCore (x)
:precision binary64
(let* ((t_0 (- 1.0 (cos x))) (t_1 (/ t_0 (sin x))))
(if (<= t_1 -0.003)
(/ (* t_0 (* (/ 1.0 t_0) t_0)) (sin x))
(if (<= t_1 0.02)
(+
(* 0.5 x)
(+
(* 0.041666666666666664 (pow x 3.0))
(+
(* 0.004166666666666667 (pow x 5.0))
(* 0.00042162698412698415 (pow x 7.0)))))
t_1))))double code(double x) {
return (1.0 - cos(x)) / sin(x);
}
↓
double code(double x) {
double t_0 = 1.0 - cos(x);
double t_1 = t_0 / sin(x);
double tmp;
if (t_1 <= -0.003) {
tmp = (t_0 * ((1.0 / t_0) * t_0)) / sin(x);
} else if (t_1 <= 0.02) {
tmp = (0.5 * x) + ((0.041666666666666664 * pow(x, 3.0)) + ((0.004166666666666667 * pow(x, 5.0)) + (0.00042162698412698415 * pow(x, 7.0))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 - cos(x)) / sin(x)
end function
↓
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - cos(x)
t_1 = t_0 / sin(x)
if (t_1 <= (-0.003d0)) then
tmp = (t_0 * ((1.0d0 / t_0) * t_0)) / sin(x)
else if (t_1 <= 0.02d0) then
tmp = (0.5d0 * x) + ((0.041666666666666664d0 * (x ** 3.0d0)) + ((0.004166666666666667d0 * (x ** 5.0d0)) + (0.00042162698412698415d0 * (x ** 7.0d0))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x) {
return (1.0 - Math.cos(x)) / Math.sin(x);
}
↓
public static double code(double x) {
double t_0 = 1.0 - Math.cos(x);
double t_1 = t_0 / Math.sin(x);
double tmp;
if (t_1 <= -0.003) {
tmp = (t_0 * ((1.0 / t_0) * t_0)) / Math.sin(x);
} else if (t_1 <= 0.02) {
tmp = (0.5 * x) + ((0.041666666666666664 * Math.pow(x, 3.0)) + ((0.004166666666666667 * Math.pow(x, 5.0)) + (0.00042162698412698415 * Math.pow(x, 7.0))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x):
return (1.0 - math.cos(x)) / math.sin(x)
↓
def code(x):
t_0 = 1.0 - math.cos(x)
t_1 = t_0 / math.sin(x)
tmp = 0
if t_1 <= -0.003:
tmp = (t_0 * ((1.0 / t_0) * t_0)) / math.sin(x)
elif t_1 <= 0.02:
tmp = (0.5 * x) + ((0.041666666666666664 * math.pow(x, 3.0)) + ((0.004166666666666667 * math.pow(x, 5.0)) + (0.00042162698412698415 * math.pow(x, 7.0))))
else:
tmp = t_1
return tmp
function code(x)
return Float64(Float64(1.0 - cos(x)) / sin(x))
end
↓
function code(x)
t_0 = Float64(1.0 - cos(x))
t_1 = Float64(t_0 / sin(x))
tmp = 0.0
if (t_1 <= -0.003)
tmp = Float64(Float64(t_0 * Float64(Float64(1.0 / t_0) * t_0)) / sin(x));
elseif (t_1 <= 0.02)
tmp = Float64(Float64(0.5 * x) + Float64(Float64(0.041666666666666664 * (x ^ 3.0)) + Float64(Float64(0.004166666666666667 * (x ^ 5.0)) + Float64(0.00042162698412698415 * (x ^ 7.0)))));
else
tmp = t_1;
end
return tmp
end
function tmp = code(x)
tmp = (1.0 - cos(x)) / sin(x);
end
↓
function tmp_2 = code(x)
t_0 = 1.0 - cos(x);
t_1 = t_0 / sin(x);
tmp = 0.0;
if (t_1 <= -0.003)
tmp = (t_0 * ((1.0 / t_0) * t_0)) / sin(x);
elseif (t_1 <= 0.02)
tmp = (0.5 * x) + ((0.041666666666666664 * (x ^ 3.0)) + ((0.004166666666666667 * (x ^ 5.0)) + (0.00042162698412698415 * (x ^ 7.0))));
else
tmp = t_1;
end
tmp_2 = tmp;
end
code[x_] := N[(N[(1.0 - N[Cos[x], $MachinePrecision]), $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]
↓
code[x_] := Block[{t$95$0 = N[(1.0 - N[Cos[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[Sin[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -0.003], N[(N[(t$95$0 * N[(N[(1.0 / t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.02], N[(N[(0.5 * x), $MachinePrecision] + N[(N[(0.041666666666666664 * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(0.004166666666666667 * N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision] + N[(0.00042162698412698415 * N[Power[x, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\frac{1 - \cos x}{\sin x}
↓
\begin{array}{l}
t_0 := 1 - \cos x\\
t_1 := \frac{t_0}{\sin x}\\
\mathbf{if}\;t_1 \leq -0.003:\\
\;\;\;\;\frac{t_0 \cdot \left(\frac{1}{t_0} \cdot t_0\right)}{\sin x}\\
\mathbf{elif}\;t_1 \leq 0.02:\\
\;\;\;\;0.5 \cdot x + \left(0.041666666666666664 \cdot {x}^{3} + \left(0.004166666666666667 \cdot {x}^{5} + 0.00042162698412698415 \cdot {x}^{7}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}