Math FPCore C Java Python Julia MATLAB Wolfram TeX \[\frac{\pi}{2} - 2 \cdot \sin^{-1} \left(\sqrt{\frac{1 - x}{2}}\right)
\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.65 \cdot 10^{-162}:\\
\;\;\;\;\frac{\pi}{2} + 2 \cdot \left(\cos^{-1} \left(\sqrt{0.5}\right) - \pi \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi}{2} - 2 \cdot \sin^{-1} \left(\frac{1}{\sqrt{\frac{2}{1 - x}}}\right)\\
\end{array}
\]
(FPCore (x)
:precision binary64
(- (/ PI 2.0) (* 2.0 (asin (sqrt (/ (- 1.0 x) 2.0)))))) ↓
(FPCore (x)
:precision binary64
(if (<= x 1.65e-162)
(+ (/ PI 2.0) (* 2.0 (- (acos (sqrt 0.5)) (* PI 0.5))))
(- (/ PI 2.0) (* 2.0 (asin (/ 1.0 (sqrt (/ 2.0 (- 1.0 x))))))))) double code(double x) {
return (((double) M_PI) / 2.0) - (2.0 * asin(sqrt(((1.0 - x) / 2.0))));
}
↓
double code(double x) {
double tmp;
if (x <= 1.65e-162) {
tmp = (((double) M_PI) / 2.0) + (2.0 * (acos(sqrt(0.5)) - (((double) M_PI) * 0.5)));
} else {
tmp = (((double) M_PI) / 2.0) - (2.0 * asin((1.0 / sqrt((2.0 / (1.0 - x))))));
}
return tmp;
}
public static double code(double x) {
return (Math.PI / 2.0) - (2.0 * Math.asin(Math.sqrt(((1.0 - x) / 2.0))));
}
↓
public static double code(double x) {
double tmp;
if (x <= 1.65e-162) {
tmp = (Math.PI / 2.0) + (2.0 * (Math.acos(Math.sqrt(0.5)) - (Math.PI * 0.5)));
} else {
tmp = (Math.PI / 2.0) - (2.0 * Math.asin((1.0 / Math.sqrt((2.0 / (1.0 - x))))));
}
return tmp;
}
def code(x):
return (math.pi / 2.0) - (2.0 * math.asin(math.sqrt(((1.0 - x) / 2.0))))
↓
def code(x):
tmp = 0
if x <= 1.65e-162:
tmp = (math.pi / 2.0) + (2.0 * (math.acos(math.sqrt(0.5)) - (math.pi * 0.5)))
else:
tmp = (math.pi / 2.0) - (2.0 * math.asin((1.0 / math.sqrt((2.0 / (1.0 - x))))))
return tmp
function code(x)
return Float64(Float64(pi / 2.0) - Float64(2.0 * asin(sqrt(Float64(Float64(1.0 - x) / 2.0)))))
end
↓
function code(x)
tmp = 0.0
if (x <= 1.65e-162)
tmp = Float64(Float64(pi / 2.0) + Float64(2.0 * Float64(acos(sqrt(0.5)) - Float64(pi * 0.5))));
else
tmp = Float64(Float64(pi / 2.0) - Float64(2.0 * asin(Float64(1.0 / sqrt(Float64(2.0 / Float64(1.0 - x)))))));
end
return tmp
end
function tmp = code(x)
tmp = (pi / 2.0) - (2.0 * asin(sqrt(((1.0 - x) / 2.0))));
end
↓
function tmp_2 = code(x)
tmp = 0.0;
if (x <= 1.65e-162)
tmp = (pi / 2.0) + (2.0 * (acos(sqrt(0.5)) - (pi * 0.5)));
else
tmp = (pi / 2.0) - (2.0 * asin((1.0 / sqrt((2.0 / (1.0 - x))))));
end
tmp_2 = tmp;
end
code[x_] := N[(N[(Pi / 2.0), $MachinePrecision] - N[(2.0 * N[ArcSin[N[Sqrt[N[(N[(1.0 - x), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_] := If[LessEqual[x, 1.65e-162], N[(N[(Pi / 2.0), $MachinePrecision] + N[(2.0 * N[(N[ArcCos[N[Sqrt[0.5], $MachinePrecision]], $MachinePrecision] - N[(Pi * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi / 2.0), $MachinePrecision] - N[(2.0 * N[ArcSin[N[(1.0 / N[Sqrt[N[(2.0 / N[(1.0 - x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\frac{\pi}{2} - 2 \cdot \sin^{-1} \left(\sqrt{\frac{1 - x}{2}}\right)
↓
\begin{array}{l}
\mathbf{if}\;x \leq 1.65 \cdot 10^{-162}:\\
\;\;\;\;\frac{\pi}{2} + 2 \cdot \left(\cos^{-1} \left(\sqrt{0.5}\right) - \pi \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi}{2} - 2 \cdot \sin^{-1} \left(\frac{1}{\sqrt{\frac{2}{1 - x}}}\right)\\
\end{array}