Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+163}:\\
\;\;\;\;\frac{\frac{y + z}{\frac{y}{y - z}}}{2}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+84}:\\
\;\;\;\;0.5 \cdot \left(y + \frac{{x}^{2} - {z}^{2}}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(y + z\right) \cdot \frac{y - z}{y}\right)\\
\end{array}
\]
(FPCore (x y z)
:precision binary64
(/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0))) ↓
(FPCore (x y z)
:precision binary64
(if (<= y -2e+163)
(/ (/ (+ y z) (/ y (- y z))) 2.0)
(if (<= y 1.55e+84)
(* 0.5 (+ y (/ (- (pow x 2.0) (pow z 2.0)) y)))
(* 0.5 (* (+ y z) (/ (- y z) y)))))) double code(double x, double y, double z) {
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
↓
double code(double x, double y, double z) {
double tmp;
if (y <= -2e+163) {
tmp = ((y + z) / (y / (y - z))) / 2.0;
} else if (y <= 1.55e+84) {
tmp = 0.5 * (y + ((pow(x, 2.0) - pow(z, 2.0)) / y));
} else {
tmp = 0.5 * ((y + z) * ((y - z) / y));
}
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 = (((x * x) + (y * y)) - (z * z)) / (y * 2.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) :: tmp
if (y <= (-2d+163)) then
tmp = ((y + z) / (y / (y - z))) / 2.0d0
else if (y <= 1.55d+84) then
tmp = 0.5d0 * (y + (((x ** 2.0d0) - (z ** 2.0d0)) / y))
else
tmp = 0.5d0 * ((y + z) * ((y - z) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
↓
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2e+163) {
tmp = ((y + z) / (y / (y - z))) / 2.0;
} else if (y <= 1.55e+84) {
tmp = 0.5 * (y + ((Math.pow(x, 2.0) - Math.pow(z, 2.0)) / y));
} else {
tmp = 0.5 * ((y + z) * ((y - z) / y));
}
return tmp;
}
def code(x, y, z):
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0)
↓
def code(x, y, z):
tmp = 0
if y <= -2e+163:
tmp = ((y + z) / (y / (y - z))) / 2.0
elif y <= 1.55e+84:
tmp = 0.5 * (y + ((math.pow(x, 2.0) - math.pow(z, 2.0)) / y))
else:
tmp = 0.5 * ((y + z) * ((y - z) / y))
return tmp
function code(x, y, z)
return Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0))
end
↓
function code(x, y, z)
tmp = 0.0
if (y <= -2e+163)
tmp = Float64(Float64(Float64(y + z) / Float64(y / Float64(y - z))) / 2.0);
elseif (y <= 1.55e+84)
tmp = Float64(0.5 * Float64(y + Float64(Float64((x ^ 2.0) - (z ^ 2.0)) / y)));
else
tmp = Float64(0.5 * Float64(Float64(y + z) * Float64(Float64(y - z) / y)));
end
return tmp
end
function tmp = code(x, y, z)
tmp = (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
end
↓
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -2e+163)
tmp = ((y + z) / (y / (y - z))) / 2.0;
elseif (y <= 1.55e+84)
tmp = 0.5 * (y + (((x ^ 2.0) - (z ^ 2.0)) / y));
else
tmp = 0.5 * ((y + z) * ((y - z) / y));
end
tmp_2 = tmp;
end
code[x_, y_, z_] := N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := If[LessEqual[y, -2e+163], N[(N[(N[(y + z), $MachinePrecision] / N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[y, 1.55e+84], N[(0.5 * N[(y + N[(N[(N[Power[x, 2.0], $MachinePrecision] - N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(y + z), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
↓
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+163}:\\
\;\;\;\;\frac{\frac{y + z}{\frac{y}{y - z}}}{2}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+84}:\\
\;\;\;\;0.5 \cdot \left(y + \frac{{x}^{2} - {z}^{2}}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(y + z\right) \cdot \frac{y - z}{y}\right)\\
\end{array}