\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\]
↓
\[\frac{\frac{1}{x \cdot {\left(1 + x\right)}^{-0.5} + \sqrt{x}}}{1 + x}
\]
(FPCore (x) :precision binary64 (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))
↓
(FPCore (x)
:precision binary64
(/ (/ 1.0 (+ (* x (pow (+ 1.0 x) -0.5)) (sqrt x))) (+ 1.0 x)))
double code(double x) {
return (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
}
↓
double code(double x) {
return (1.0 / ((x * pow((1.0 + x), -0.5)) + sqrt(x))) / (1.0 + x);
}
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
code = (1.0d0 / ((x * ((1.0d0 + x) ** (-0.5d0))) + sqrt(x))) / (1.0d0 + x)
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) {
return (1.0 / ((x * Math.pow((1.0 + x), -0.5)) + Math.sqrt(x))) / (1.0 + x);
}
def code(x):
return (1.0 / math.sqrt(x)) - (1.0 / math.sqrt((x + 1.0)))
↓
def code(x):
return (1.0 / ((x * math.pow((1.0 + x), -0.5)) + math.sqrt(x))) / (1.0 + x)
function code(x)
return Float64(Float64(1.0 / sqrt(x)) - Float64(1.0 / sqrt(Float64(x + 1.0))))
end
↓
function code(x)
return Float64(Float64(1.0 / Float64(Float64(x * (Float64(1.0 + x) ^ -0.5)) + sqrt(x))) / Float64(1.0 + x))
end
function tmp = code(x)
tmp = (1.0 / sqrt(x)) - (1.0 / sqrt((x + 1.0)));
end
↓
function tmp = code(x)
tmp = (1.0 / ((x * ((1.0 + x) ^ -0.5)) + sqrt(x))) / (1.0 + x);
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_] := N[(N[(1.0 / N[(N[(x * N[Power[N[(1.0 + x), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
↓
\frac{\frac{1}{x \cdot {\left(1 + x\right)}^{-0.5} + \sqrt{x}}}{1 + x}
Alternatives
| Alternative 1 |
|---|
| Error | 0.4 |
|---|
| Cost | 26692 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{1 + x}} \leq 5 \cdot 10^{-13}:\\
\;\;\;\;\frac{0.5 \cdot \sqrt{\frac{1}{x}}}{1 + x}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 6.5 |
|---|
| Cost | 7108 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.08382833180574063:\\
\;\;\;\;\left({x}^{-0.5} + x \cdot 0.5\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{x} \cdot 0.5}{x \cdot \left(1 + x\right)}\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 1.0 |
|---|
| Cost | 7108 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.08382833180574063:\\
\;\;\;\;\left({x}^{-0.5} + x \cdot 0.5\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \sqrt{\frac{1}{x}}}{1 + x}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 20.4 |
|---|
| Cost | 7044 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.08382833180574063:\\
\;\;\;\;\left({x}^{-0.5} + x \cdot 0.5\right) + -1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x \cdot \left(1 + x\right)}}\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 20.5 |
|---|
| Cost | 6980 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.08382833180574063:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x \cdot \left(1 + x\right)}}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 21.0 |
|---|
| Cost | 6788 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.08382833180574063:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{1}{x + 0.5}\right) + -1\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 21.6 |
|---|
| Cost | 6660 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 7.948415199002043 \cdot 10^{+122}:\\
\;\;\;\;{x}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{1}{x + 0.5}\right) + -1\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 49.9 |
|---|
| Cost | 576 |
|---|
\[\left(1 + \frac{1}{x + 0.5}\right) + -1
\]
| Alternative 9 |
|---|
| Error | 59.3 |
|---|
| Cost | 320 |
|---|
\[\frac{1}{x + 0.5}
\]
| Alternative 10 |
|---|
| Error | 59.3 |
|---|
| Cost | 192 |
|---|
\[\frac{1}{x}
\]
| Alternative 11 |
|---|
| Error | 60.3 |
|---|
| Cost | 64 |
|---|
\[2
\]