\[\frac{1 - \cos x}{x \cdot x}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \leq -0.5:\\
\;\;\;\;\frac{\tan \left(x \cdot 0.5\right)}{x \cdot x} \cdot \sin x\\
\mathbf{elif}\;x \leq 0.0055:\\
\;\;\;\;0.5 + \left(x \cdot x\right) \cdot -0.041666666666666664\\
\mathbf{else}:\\
\;\;\;\;{x}^{-2} \cdot \left(1 - \cos x\right)\\
\end{array}
\]
(FPCore (x) :precision binary64 (/ (- 1.0 (cos x)) (* x x)))
↓
(FPCore (x)
:precision binary64
(if (<= x -0.5)
(* (/ (tan (* x 0.5)) (* x x)) (sin x))
(if (<= x 0.0055)
(+ 0.5 (* (* x x) -0.041666666666666664))
(* (pow x -2.0) (- 1.0 (cos x))))))double code(double x) {
return (1.0 - cos(x)) / (x * x);
}
↓
double code(double x) {
double tmp;
if (x <= -0.5) {
tmp = (tan((x * 0.5)) / (x * x)) * sin(x);
} else if (x <= 0.0055) {
tmp = 0.5 + ((x * x) * -0.041666666666666664);
} else {
tmp = pow(x, -2.0) * (1.0 - cos(x));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 - cos(x)) / (x * x)
end function
↓
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-0.5d0)) then
tmp = (tan((x * 0.5d0)) / (x * x)) * sin(x)
else if (x <= 0.0055d0) then
tmp = 0.5d0 + ((x * x) * (-0.041666666666666664d0))
else
tmp = (x ** (-2.0d0)) * (1.0d0 - cos(x))
end if
code = tmp
end function
public static double code(double x) {
return (1.0 - Math.cos(x)) / (x * x);
}
↓
public static double code(double x) {
double tmp;
if (x <= -0.5) {
tmp = (Math.tan((x * 0.5)) / (x * x)) * Math.sin(x);
} else if (x <= 0.0055) {
tmp = 0.5 + ((x * x) * -0.041666666666666664);
} else {
tmp = Math.pow(x, -2.0) * (1.0 - Math.cos(x));
}
return tmp;
}
def code(x):
return (1.0 - math.cos(x)) / (x * x)
↓
def code(x):
tmp = 0
if x <= -0.5:
tmp = (math.tan((x * 0.5)) / (x * x)) * math.sin(x)
elif x <= 0.0055:
tmp = 0.5 + ((x * x) * -0.041666666666666664)
else:
tmp = math.pow(x, -2.0) * (1.0 - math.cos(x))
return tmp
function code(x)
return Float64(Float64(1.0 - cos(x)) / Float64(x * x))
end
↓
function code(x)
tmp = 0.0
if (x <= -0.5)
tmp = Float64(Float64(tan(Float64(x * 0.5)) / Float64(x * x)) * sin(x));
elseif (x <= 0.0055)
tmp = Float64(0.5 + Float64(Float64(x * x) * -0.041666666666666664));
else
tmp = Float64((x ^ -2.0) * Float64(1.0 - cos(x)));
end
return tmp
end
function tmp = code(x)
tmp = (1.0 - cos(x)) / (x * x);
end
↓
function tmp_2 = code(x)
tmp = 0.0;
if (x <= -0.5)
tmp = (tan((x * 0.5)) / (x * x)) * sin(x);
elseif (x <= 0.0055)
tmp = 0.5 + ((x * x) * -0.041666666666666664);
else
tmp = (x ^ -2.0) * (1.0 - cos(x));
end
tmp_2 = tmp;
end
code[x_] := N[(N[(1.0 - N[Cos[x], $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]
↓
code[x_] := If[LessEqual[x, -0.5], N[(N[(N[Tan[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.0055], N[(0.5 + N[(N[(x * x), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision], N[(N[Power[x, -2.0], $MachinePrecision] * N[(1.0 - N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\frac{1 - \cos x}{x \cdot x}
↓
\begin{array}{l}
\mathbf{if}\;x \leq -0.5:\\
\;\;\;\;\frac{\tan \left(x \cdot 0.5\right)}{x \cdot x} \cdot \sin x\\
\mathbf{elif}\;x \leq 0.0055:\\
\;\;\;\;0.5 + \left(x \cdot x\right) \cdot -0.041666666666666664\\
\mathbf{else}:\\
\;\;\;\;{x}^{-2} \cdot \left(1 - \cos x\right)\\
\end{array}