\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.5631665013639515 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right) \cdot \left(x \cdot \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}{x}\\
\end{array}
\]
(FPCore (x) :precision binary64 (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))
↓
(FPCore (x)
:precision binary64
(if (<= x 1.5631665013639515e+82)
(/ 1.0 (* (+ (pow x -0.5) (pow (+ x 1.0) -0.5)) (* x (+ x 1.0))))
(/ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) x)))
double code(double x) {
return (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
}
↓
double code(double x) {
double tmp;
if (x <= 1.5631665013639515e+82) {
tmp = 1.0 / ((pow(x, -0.5) + pow((x + 1.0), -0.5)) * (x * (x + 1.0)));
} else {
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) / x;
}
return tmp;
}
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) :: tmp
if (x <= 1.5631665013639515d+82) then
tmp = 1.0d0 / (((x ** (-0.5d0)) + ((x + 1.0d0) ** (-0.5d0))) * (x * (x + 1.0d0)))
else
tmp = (1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) / x
end if
code = tmp
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 tmp;
if (x <= 1.5631665013639515e+82) {
tmp = 1.0 / ((Math.pow(x, -0.5) + Math.pow((x + 1.0), -0.5)) * (x * (x + 1.0)));
} else {
tmp = (1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) / x;
}
return tmp;
}
def code(x):
return (1.0 / math.sqrt(x)) - (1.0 / math.sqrt((x + 1.0)))
↓
def code(x):
tmp = 0
if x <= 1.5631665013639515e+82:
tmp = 1.0 / ((math.pow(x, -0.5) + math.pow((x + 1.0), -0.5)) * (x * (x + 1.0)))
else:
tmp = (1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) / x
return tmp
function code(x)
return Float64(Float64(1.0 / sqrt(x)) - Float64(1.0 / sqrt(Float64(x + 1.0))))
end
↓
function code(x)
tmp = 0.0
if (x <= 1.5631665013639515e+82)
tmp = Float64(1.0 / Float64(Float64((x ^ -0.5) + (Float64(x + 1.0) ^ -0.5)) * Float64(x * Float64(x + 1.0))));
else
tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) / x);
end
return tmp
end
function tmp = code(x)
tmp = (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
end
↓
function tmp_2 = code(x)
tmp = 0.0;
if (x <= 1.5631665013639515e+82)
tmp = 1.0 / (((x ^ -0.5) + ((x + 1.0) ^ -0.5)) * (x * (x + 1.0)));
else
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) / x;
end
tmp_2 = tmp;
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_] := If[LessEqual[x, 1.5631665013639515e+82], N[(1.0 / N[(N[(N[Power[x, -0.5], $MachinePrecision] + N[Power[N[(x + 1.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
↓
\begin{array}{l}
\mathbf{if}\;x \leq 1.5631665013639515 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right) \cdot \left(x \cdot \left(x + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{x + 1} + \sqrt{x}}}{x}\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.4 |
|---|
| Cost | 26820 |
|---|
\[\begin{array}{l}
t_0 := \sqrt{x + 1}\\
\mathbf{if}\;\frac{1}{\sqrt{x}} - \frac{1}{t_0} \leq 5 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{1}{t_0 + \sqrt{x}}}{x}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} - {\left(x + 1\right)}^{-0.5}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.4 |
|---|
| Cost | 20224 |
|---|
\[{\left(x \cdot \left({x}^{-0.5} + {\left(x + 1\right)}^{-0.5}\right)\right)}^{-1} \cdot \frac{1}{x + 1}
\]
| Alternative 3 |
|---|
| Error | 0.5 |
|---|
| Cost | 14016 |
|---|
\[\frac{1}{x + 1} \cdot \left(\frac{1}{{x}^{-0.5} + {\left(x + 1\right)}^{-0.5}} \cdot \frac{1}{x}\right)
\]
| Alternative 4 |
|---|
| Error | 0.8 |
|---|
| Cost | 13380 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1462373.4357213434:\\
\;\;\;\;{x}^{-0.5} - {\left(x + 1\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 \cdot {x}^{1.5}}\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 1.3 |
|---|
| Cost | 7044 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.029275776111882246:\\
\;\;\;\;-1 + \left({x}^{-0.5} + x \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 \cdot {x}^{1.5}}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 1.5 |
|---|
| Cost | 6916 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.029275776111882246:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2 \cdot {x}^{1.5}}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 20.8 |
|---|
| Cost | 6852 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 9.724842711893388 \cdot 10^{+151}:\\
\;\;\;\;\frac{1}{x + \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(1 - x\right)}{x}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 20.9 |
|---|
| Cost | 6788 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.029275776111882246:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(1 - x\right)}{x}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 50.5 |
|---|
| Cost | 448 |
|---|
\[\frac{x + \left(1 - x\right)}{x}
\]
| Alternative 10 |
|---|
| Error | 59.3 |
|---|
| Cost | 192 |
|---|
\[\frac{1}{x}
\]
| Alternative 11 |
|---|
| Error | 62.8 |
|---|
| Cost | 64 |
|---|
\[-1
\]