Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\sqrt{x \cdot x + y}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+154}:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq 10^{+55}:\\
\;\;\;\;\sqrt{x \cdot x + y}\\
\mathbf{else}:\\
\;\;\;\;x + 0.5 \cdot \frac{y}{x}\\
\end{array}
\]
(FPCore (x y) :precision binary64 (sqrt (+ (* x x) y))) ↓
(FPCore (x y)
:precision binary64
(if (<= x -1.5e+154)
(- x)
(if (<= x 1e+55) (sqrt (+ (* x x) y)) (+ x (* 0.5 (/ y x)))))) double code(double x, double y) {
return sqrt(((x * x) + y));
}
↓
double code(double x, double y) {
double tmp;
if (x <= -1.5e+154) {
tmp = -x;
} else if (x <= 1e+55) {
tmp = sqrt(((x * x) + y));
} else {
tmp = x + (0.5 * (y / 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 <= (-1.5d+154)) then
tmp = -x
else if (x <= 1d+55) then
tmp = sqrt(((x * x) + y))
else
tmp = x + (0.5d0 * (y / 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 <= -1.5e+154) {
tmp = -x;
} else if (x <= 1e+55) {
tmp = Math.sqrt(((x * x) + y));
} else {
tmp = x + (0.5 * (y / x));
}
return tmp;
}
def code(x, y):
return math.sqrt(((x * x) + y))
↓
def code(x, y):
tmp = 0
if x <= -1.5e+154:
tmp = -x
elif x <= 1e+55:
tmp = math.sqrt(((x * x) + y))
else:
tmp = x + (0.5 * (y / x))
return tmp
function code(x, y)
return sqrt(Float64(Float64(x * x) + y))
end
↓
function code(x, y)
tmp = 0.0
if (x <= -1.5e+154)
tmp = Float64(-x);
elseif (x <= 1e+55)
tmp = sqrt(Float64(Float64(x * x) + y));
else
tmp = Float64(x + Float64(0.5 * Float64(y / 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 <= -1.5e+154)
tmp = -x;
elseif (x <= 1e+55)
tmp = sqrt(((x * x) + y));
else
tmp = x + (0.5 * (y / 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, -1.5e+154], (-x), If[LessEqual[x, 1e+55], N[Sqrt[N[(N[(x * x), $MachinePrecision] + y), $MachinePrecision]], $MachinePrecision], N[(x + N[(0.5 * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\sqrt{x \cdot x + y}
↓
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+154}:\\
\;\;\;\;-x\\
\mathbf{elif}\;x \leq 10^{+55}:\\
\;\;\;\;\sqrt{x \cdot x + y}\\
\mathbf{else}:\\
\;\;\;\;x + 0.5 \cdot \frac{y}{x}\\
\end{array}