\[ \begin{array}{c}[x, y, z] = \mathsf{sort}([x, y, z])\\ \end{array} \]
Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}
\]
↓
\[\begin{array}{l}
t_0 := z \cdot \sqrt{0.3333333333333333}\\
t_1 := \sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{+146}:\\
\;\;\;\;\sqrt{0.3333333333333333} \cdot \left(-x\right)\\
\mathbf{elif}\;x \leq -63000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;t_0 + 0.5 \cdot \left(\left({y}^{2} + {x}^{2}\right) \cdot \frac{\sqrt{0.3333333333333333}}{z}\right)\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
(FPCore (x y z)
:precision binary64
(sqrt (/ (+ (+ (* x x) (* y y)) (* z z)) 3.0))) ↓
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sqrt 0.3333333333333333)))
(t_1 (sqrt (/ (+ (+ (* x x) (* y y)) (* z z)) 3.0))))
(if (<= x -7.2e+146)
(* (sqrt 0.3333333333333333) (- x))
(if (<= x -63000000.0)
t_1
(if (<= x -1.05e-7)
(+
t_0
(*
0.5
(* (+ (pow y 2.0) (pow x 2.0)) (/ (sqrt 0.3333333333333333) z))))
(if (<= x -3.8e-65) t_1 t_0)))))) double code(double x, double y, double z) {
return sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0));
}
↓
double code(double x, double y, double z) {
double t_0 = z * sqrt(0.3333333333333333);
double t_1 = sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0));
double tmp;
if (x <= -7.2e+146) {
tmp = sqrt(0.3333333333333333) * -x;
} else if (x <= -63000000.0) {
tmp = t_1;
} else if (x <= -1.05e-7) {
tmp = t_0 + (0.5 * ((pow(y, 2.0) + pow(x, 2.0)) * (sqrt(0.3333333333333333) / z)));
} else if (x <= -3.8e-65) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0d0))
end function
↓
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = z * sqrt(0.3333333333333333d0)
t_1 = sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0d0))
if (x <= (-7.2d+146)) then
tmp = sqrt(0.3333333333333333d0) * -x
else if (x <= (-63000000.0d0)) then
tmp = t_1
else if (x <= (-1.05d-7)) then
tmp = t_0 + (0.5d0 * (((y ** 2.0d0) + (x ** 2.0d0)) * (sqrt(0.3333333333333333d0) / z)))
else if (x <= (-3.8d-65)) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
return Math.sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0));
}
↓
public static double code(double x, double y, double z) {
double t_0 = z * Math.sqrt(0.3333333333333333);
double t_1 = Math.sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0));
double tmp;
if (x <= -7.2e+146) {
tmp = Math.sqrt(0.3333333333333333) * -x;
} else if (x <= -63000000.0) {
tmp = t_1;
} else if (x <= -1.05e-7) {
tmp = t_0 + (0.5 * ((Math.pow(y, 2.0) + Math.pow(x, 2.0)) * (Math.sqrt(0.3333333333333333) / z)));
} else if (x <= -3.8e-65) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z):
return math.sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0))
↓
def code(x, y, z):
t_0 = z * math.sqrt(0.3333333333333333)
t_1 = math.sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0))
tmp = 0
if x <= -7.2e+146:
tmp = math.sqrt(0.3333333333333333) * -x
elif x <= -63000000.0:
tmp = t_1
elif x <= -1.05e-7:
tmp = t_0 + (0.5 * ((math.pow(y, 2.0) + math.pow(x, 2.0)) * (math.sqrt(0.3333333333333333) / z)))
elif x <= -3.8e-65:
tmp = t_1
else:
tmp = t_0
return tmp
function code(x, y, z)
return sqrt(Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) + Float64(z * z)) / 3.0))
end
↓
function code(x, y, z)
t_0 = Float64(z * sqrt(0.3333333333333333))
t_1 = sqrt(Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) + Float64(z * z)) / 3.0))
tmp = 0.0
if (x <= -7.2e+146)
tmp = Float64(sqrt(0.3333333333333333) * Float64(-x));
elseif (x <= -63000000.0)
tmp = t_1;
elseif (x <= -1.05e-7)
tmp = Float64(t_0 + Float64(0.5 * Float64(Float64((y ^ 2.0) + (x ^ 2.0)) * Float64(sqrt(0.3333333333333333) / z))));
elseif (x <= -3.8e-65)
tmp = t_1;
else
tmp = t_0;
end
return tmp
end
function tmp = code(x, y, z)
tmp = sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0));
end
↓
function tmp_2 = code(x, y, z)
t_0 = z * sqrt(0.3333333333333333);
t_1 = sqrt(((((x * x) + (y * y)) + (z * z)) / 3.0));
tmp = 0.0;
if (x <= -7.2e+146)
tmp = sqrt(0.3333333333333333) * -x;
elseif (x <= -63000000.0)
tmp = t_1;
elseif (x <= -1.05e-7)
tmp = t_0 + (0.5 * (((y ^ 2.0) + (x ^ 2.0)) * (sqrt(0.3333333333333333) / z)));
elseif (x <= -3.8e-65)
tmp = t_1;
else
tmp = t_0;
end
tmp_2 = tmp;
end
code[x_, y_, z_] := N[Sqrt[N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(z * z), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]], $MachinePrecision]
↓
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sqrt[0.3333333333333333], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(z * z), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -7.2e+146], N[(N[Sqrt[0.3333333333333333], $MachinePrecision] * (-x)), $MachinePrecision], If[LessEqual[x, -63000000.0], t$95$1, If[LessEqual[x, -1.05e-7], N[(t$95$0 + N[(0.5 * N[(N[(N[Power[y, 2.0], $MachinePrecision] + N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[0.3333333333333333], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.8e-65], t$95$1, t$95$0]]]]]]
\sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}
↓
\begin{array}{l}
t_0 := z \cdot \sqrt{0.3333333333333333}\\
t_1 := \sqrt{\frac{\left(x \cdot x + y \cdot y\right) + z \cdot z}{3}}\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{+146}:\\
\;\;\;\;\sqrt{0.3333333333333333} \cdot \left(-x\right)\\
\mathbf{elif}\;x \leq -63000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;t_0 + 0.5 \cdot \left(\left({y}^{2} + {x}^{2}\right) \cdot \frac{\sqrt{0.3333333333333333}}{z}\right)\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}