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