\[ \begin{array}{c}[x, y] = \mathsf{sort}([x, y])\\ \end{array} \]
Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\sqrt{x \cdot x + y \cdot y}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;y \leq 1.22 \cdot 10^{-229}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-176}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+77}:\\
\;\;\;\;\sqrt{x \cdot x + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
(FPCore (x y) :precision binary64 (sqrt (+ (* x x) (* y y)))) ↓
(FPCore (x y)
:precision binary64
(if (<= y 1.22e-229)
(- x)
(if (<= y 5e-176) y (if (<= y 5.8e+77) (sqrt (+ (* x x) (* y y))) y)))) double code(double x, double y) {
return sqrt(((x * x) + (y * y)));
}
↓
double code(double x, double y) {
double tmp;
if (y <= 1.22e-229) {
tmp = -x;
} else if (y <= 5e-176) {
tmp = y;
} else if (y <= 5.8e+77) {
tmp = sqrt(((x * x) + (y * y)));
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(((x * x) + (y * y)))
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.22d-229) then
tmp = -x
else if (y <= 5d-176) then
tmp = y
else if (y <= 5.8d+77) then
tmp = sqrt(((x * x) + (y * y)))
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y) {
return Math.sqrt(((x * x) + (y * y)));
}
↓
public static double code(double x, double y) {
double tmp;
if (y <= 1.22e-229) {
tmp = -x;
} else if (y <= 5e-176) {
tmp = y;
} else if (y <= 5.8e+77) {
tmp = Math.sqrt(((x * x) + (y * y)));
} else {
tmp = y;
}
return tmp;
}
def code(x, y):
return math.sqrt(((x * x) + (y * y)))
↓
def code(x, y):
tmp = 0
if y <= 1.22e-229:
tmp = -x
elif y <= 5e-176:
tmp = y
elif y <= 5.8e+77:
tmp = math.sqrt(((x * x) + (y * y)))
else:
tmp = y
return tmp
function code(x, y)
return sqrt(Float64(Float64(x * x) + Float64(y * y)))
end
↓
function code(x, y)
tmp = 0.0
if (y <= 1.22e-229)
tmp = Float64(-x);
elseif (y <= 5e-176)
tmp = y;
elseif (y <= 5.8e+77)
tmp = sqrt(Float64(Float64(x * x) + Float64(y * y)));
else
tmp = y;
end
return tmp
end
function tmp = code(x, y)
tmp = sqrt(((x * x) + (y * y)));
end
↓
function tmp_2 = code(x, y)
tmp = 0.0;
if (y <= 1.22e-229)
tmp = -x;
elseif (y <= 5e-176)
tmp = y;
elseif (y <= 5.8e+77)
tmp = sqrt(((x * x) + (y * y)));
else
tmp = y;
end
tmp_2 = tmp;
end
code[x_, y_] := N[Sqrt[N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
↓
code[x_, y_] := If[LessEqual[y, 1.22e-229], (-x), If[LessEqual[y, 5e-176], y, If[LessEqual[y, 5.8e+77], N[Sqrt[N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y]]]
\sqrt{x \cdot x + y \cdot y}
↓
\begin{array}{l}
\mathbf{if}\;y \leq 1.22 \cdot 10^{-229}:\\
\;\;\;\;-x\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-176}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+77}:\\
\;\;\;\;\sqrt{x \cdot x + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}