\[10^{-150} < \left|x\right| \land \left|x\right| < 10^{+150}\]
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;\frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}} \leq -0.5:\\
\;\;\;\;\frac{p}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 \cdot \left(1 + \frac{1}{\sqrt{4 \cdot \left(p \cdot p\right) + x \cdot x}} \cdot x\right)}\\
\end{array}
\]
(FPCore (p x)
:precision binary64
(sqrt (* 0.5 (+ 1.0 (/ x (sqrt (+ (* (* 4.0 p) p) (* x x))))))))
↓
(FPCore (p x)
:precision binary64
(if (<= (/ x (sqrt (+ (* (* 4.0 p) p) (* x x)))) -0.5)
(/ p x)
(sqrt (* 0.5 (+ 1.0 (* (/ 1.0 (sqrt (+ (* 4.0 (* p p)) (* x x)))) x))))))
double code(double p, double x) {
return sqrt((0.5 * (1.0 + (x / sqrt((((4.0 * p) * p) + (x * x)))))));
}
↓
double code(double p, double x) {
double tmp;
if ((x / sqrt((((4.0 * p) * p) + (x * x)))) <= -0.5) {
tmp = p / x;
} else {
tmp = sqrt((0.5 * (1.0 + ((1.0 / sqrt(((4.0 * (p * p)) + (x * x)))) * x))));
}
return tmp;
}
real(8) function code(p, x)
real(8), intent (in) :: p
real(8), intent (in) :: x
code = sqrt((0.5d0 * (1.0d0 + (x / sqrt((((4.0d0 * p) * p) + (x * x)))))))
end function
↓
real(8) function code(p, x)
real(8), intent (in) :: p
real(8), intent (in) :: x
real(8) :: tmp
if ((x / sqrt((((4.0d0 * p) * p) + (x * x)))) <= (-0.5d0)) then
tmp = p / x
else
tmp = sqrt((0.5d0 * (1.0d0 + ((1.0d0 / sqrt(((4.0d0 * (p * p)) + (x * x)))) * x))))
end if
code = tmp
end function
public static double code(double p, double x) {
return Math.sqrt((0.5 * (1.0 + (x / Math.sqrt((((4.0 * p) * p) + (x * x)))))));
}
↓
public static double code(double p, double x) {
double tmp;
if ((x / Math.sqrt((((4.0 * p) * p) + (x * x)))) <= -0.5) {
tmp = p / x;
} else {
tmp = Math.sqrt((0.5 * (1.0 + ((1.0 / Math.sqrt(((4.0 * (p * p)) + (x * x)))) * x))));
}
return tmp;
}
def code(p, x):
return math.sqrt((0.5 * (1.0 + (x / math.sqrt((((4.0 * p) * p) + (x * x)))))))
↓
def code(p, x):
tmp = 0
if (x / math.sqrt((((4.0 * p) * p) + (x * x)))) <= -0.5:
tmp = p / x
else:
tmp = math.sqrt((0.5 * (1.0 + ((1.0 / math.sqrt(((4.0 * (p * p)) + (x * x)))) * x))))
return tmp
function code(p, x)
return sqrt(Float64(0.5 * Float64(1.0 + Float64(x / sqrt(Float64(Float64(Float64(4.0 * p) * p) + Float64(x * x)))))))
end
↓
function code(p, x)
tmp = 0.0
if (Float64(x / sqrt(Float64(Float64(Float64(4.0 * p) * p) + Float64(x * x)))) <= -0.5)
tmp = Float64(p / x);
else
tmp = sqrt(Float64(0.5 * Float64(1.0 + Float64(Float64(1.0 / sqrt(Float64(Float64(4.0 * Float64(p * p)) + Float64(x * x)))) * x))));
end
return tmp
end
function tmp = code(p, x)
tmp = sqrt((0.5 * (1.0 + (x / sqrt((((4.0 * p) * p) + (x * x)))))));
end
↓
function tmp_2 = code(p, x)
tmp = 0.0;
if ((x / sqrt((((4.0 * p) * p) + (x * x)))) <= -0.5)
tmp = p / x;
else
tmp = sqrt((0.5 * (1.0 + ((1.0 / sqrt(((4.0 * (p * p)) + (x * x)))) * x))));
end
tmp_2 = tmp;
end
code[p_, x_] := N[Sqrt[N[(0.5 * N[(1.0 + N[(x / N[Sqrt[N[(N[(N[(4.0 * p), $MachinePrecision] * p), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
↓
code[p_, x_] := If[LessEqual[N[(x / N[Sqrt[N[(N[(N[(4.0 * p), $MachinePrecision] * p), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.5], N[(p / x), $MachinePrecision], N[Sqrt[N[(0.5 * N[(1.0 + N[(N[(1.0 / N[Sqrt[N[(N[(4.0 * N[(p * p), $MachinePrecision]), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}
↓
\begin{array}{l}
\mathbf{if}\;\frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}} \leq -0.5:\\
\;\;\;\;\frac{p}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 \cdot \left(1 + \frac{1}{\sqrt{4 \cdot \left(p \cdot p\right) + x \cdot x}} \cdot x\right)}\\
\end{array}