\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\]
↓
\[\begin{array}{l}
t_0 := \frac{1}{\sqrt{x}}\\
t_1 := \sqrt{x + 1}\\
t_2 := t_1 + \sqrt{x}\\
t_3 := \begin{array}{l}
\mathbf{if}\;t_2 \ne 0:\\
\;\;\;\;\frac{1}{t_2}\\
\mathbf{else}:\\
\;\;\;\;t_1 - \sqrt{x}\\
\end{array}\\
\mathbf{if}\;t_0 \ne 0:\\
\;\;\;\;\frac{t_3}{\frac{t_1}{t_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_3}{\sqrt{x} \cdot t_1}\\
\end{array}
\]
(FPCore (x) :precision binary64 (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))
↓
(FPCore (x)
:precision binary64
(let* ((t_0 (/ 1.0 (sqrt x)))
(t_1 (sqrt (+ x 1.0)))
(t_2 (+ t_1 (sqrt x)))
(t_3 (if (!= t_2 0.0) (/ 1.0 t_2) (- t_1 (sqrt x)))))
(if (!= t_0 0.0) (/ t_3 (/ t_1 t_0)) (/ t_3 (* (sqrt x) t_1)))))double code(double x) {
return (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
}
↓
double code(double x) {
double t_0 = 1.0 / sqrt(x);
double t_1 = sqrt((x + 1.0));
double t_2 = t_1 + sqrt(x);
double tmp;
if (t_2 != 0.0) {
tmp = 1.0 / t_2;
} else {
tmp = t_1 - sqrt(x);
}
double t_3 = tmp;
double tmp_1;
if (t_0 != 0.0) {
tmp_1 = t_3 / (t_1 / t_0);
} else {
tmp_1 = t_3 / (sqrt(x) * t_1);
}
return tmp_1;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 / sqrt(x)) - (1.0d0 / sqrt((x + 1.0d0)))
end function
↓
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
real(8) :: tmp_1
t_0 = 1.0d0 / sqrt(x)
t_1 = sqrt((x + 1.0d0))
t_2 = t_1 + sqrt(x)
if (t_2 /= 0.0d0) then
tmp = 1.0d0 / t_2
else
tmp = t_1 - sqrt(x)
end if
t_3 = tmp
if (t_0 /= 0.0d0) then
tmp_1 = t_3 / (t_1 / t_0)
else
tmp_1 = t_3 / (sqrt(x) * t_1)
end if
code = tmp_1
end function
public static double code(double x) {
return (1.0 / Math.sqrt(x)) - (1.0 / Math.sqrt((x + 1.0)));
}
↓
public static double code(double x) {
double t_0 = 1.0 / Math.sqrt(x);
double t_1 = Math.sqrt((x + 1.0));
double t_2 = t_1 + Math.sqrt(x);
double tmp;
if (t_2 != 0.0) {
tmp = 1.0 / t_2;
} else {
tmp = t_1 - Math.sqrt(x);
}
double t_3 = tmp;
double tmp_1;
if (t_0 != 0.0) {
tmp_1 = t_3 / (t_1 / t_0);
} else {
tmp_1 = t_3 / (Math.sqrt(x) * t_1);
}
return tmp_1;
}
def code(x):
return (1.0 / math.sqrt(x)) - (1.0 / math.sqrt((x + 1.0)))
↓
def code(x):
t_0 = 1.0 / math.sqrt(x)
t_1 = math.sqrt((x + 1.0))
t_2 = t_1 + math.sqrt(x)
tmp = 0
if t_2 != 0.0:
tmp = 1.0 / t_2
else:
tmp = t_1 - math.sqrt(x)
t_3 = tmp
tmp_1 = 0
if t_0 != 0.0:
tmp_1 = t_3 / (t_1 / t_0)
else:
tmp_1 = t_3 / (math.sqrt(x) * t_1)
return tmp_1
function code(x)
return Float64(Float64(1.0 / sqrt(x)) - Float64(1.0 / sqrt(Float64(x + 1.0))))
end
↓
function code(x)
t_0 = Float64(1.0 / sqrt(x))
t_1 = sqrt(Float64(x + 1.0))
t_2 = Float64(t_1 + sqrt(x))
tmp = 0.0
if (t_2 != 0.0)
tmp = Float64(1.0 / t_2);
else
tmp = Float64(t_1 - sqrt(x));
end
t_3 = tmp
tmp_1 = 0.0
if (t_0 != 0.0)
tmp_1 = Float64(t_3 / Float64(t_1 / t_0));
else
tmp_1 = Float64(t_3 / Float64(sqrt(x) * t_1));
end
return tmp_1
end
function tmp = code(x)
tmp = (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
end
↓
function tmp_3 = code(x)
t_0 = 1.0 / sqrt(x);
t_1 = sqrt((x + 1.0));
t_2 = t_1 + sqrt(x);
tmp = 0.0;
if (t_2 ~= 0.0)
tmp = 1.0 / t_2;
else
tmp = t_1 - sqrt(x);
end
t_3 = tmp;
tmp_2 = 0.0;
if (t_0 ~= 0.0)
tmp_2 = t_3 / (t_1 / t_0);
else
tmp_2 = t_3 / (sqrt(x) * t_1);
end
tmp_3 = tmp_2;
end
code[x_] := N[(N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = If[Unequal[t$95$2, 0.0], N[(1.0 / t$95$2), $MachinePrecision], N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]}, If[Unequal[t$95$0, 0.0], N[(t$95$3 / N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision], N[(t$95$3 / N[(N[Sqrt[x], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
↓
\begin{array}{l}
t_0 := \frac{1}{\sqrt{x}}\\
t_1 := \sqrt{x + 1}\\
t_2 := t_1 + \sqrt{x}\\
t_3 := \begin{array}{l}
\mathbf{if}\;t_2 \ne 0:\\
\;\;\;\;\frac{1}{t_2}\\
\mathbf{else}:\\
\;\;\;\;t_1 - \sqrt{x}\\
\end{array}\\
\mathbf{if}\;t_0 \ne 0:\\
\;\;\;\;\frac{t_3}{\frac{t_1}{t_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_3}{\sqrt{x} \cdot t_1}\\
\end{array}