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