\[\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
\]
↓
\[\frac{\left(1 + \left(x - x\right)\right) \cdot {\left({\left(\mathsf{hypot}\left(x, \sqrt{x}\right)\right)}^{-0.5}\right)}^{2}}{\sqrt{x} + \sqrt{1 + x}}
\]
(FPCore (x) :precision binary64 (- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))
↓
(FPCore (x)
:precision binary64
(/
(* (+ 1.0 (- x x)) (pow (pow (hypot x (sqrt x)) -0.5) 2.0))
(+ (sqrt x) (sqrt (+ 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 - x)) * pow(pow(hypot(x, sqrt(x)), -0.5), 2.0)) / (sqrt(x) + sqrt((1.0 + x)));
}
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 - x)) * Math.pow(Math.pow(Math.hypot(x, Math.sqrt(x)), -0.5), 2.0)) / (Math.sqrt(x) + Math.sqrt((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 - x)) * math.pow(math.pow(math.hypot(x, math.sqrt(x)), -0.5), 2.0)) / (math.sqrt(x) + math.sqrt((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(Float64(1.0 + Float64(x - x)) * ((hypot(x, sqrt(x)) ^ -0.5) ^ 2.0)) / Float64(sqrt(x) + sqrt(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 - x)) * ((hypot(x, sqrt(x)) ^ -0.5) ^ 2.0)) / (sqrt(x) + sqrt((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[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[Sqrt[x ^ 2 + N[Sqrt[x], $MachinePrecision] ^ 2], $MachinePrecision], -0.5], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{1}{\sqrt{x}} - \frac{1}{\sqrt{x + 1}}
↓
\frac{\left(1 + \left(x - x\right)\right) \cdot {\left({\left(\mathsf{hypot}\left(x, \sqrt{x}\right)\right)}^{-0.5}\right)}^{2}}{\sqrt{x} + \sqrt{1 + x}}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 91.5% |
|---|
| Cost | 26692 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{1}{\sqrt{x}} + \frac{-1}{\sqrt{1 + x}} \leq 5 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{\frac{-1}{1 + x}}{-x}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 99.3% |
|---|
| Cost | 13888 |
|---|
\[\frac{\frac{1}{{x}^{-0.5} + {\left(1 + x\right)}^{-0.5}}}{-1 - x} \cdot \frac{-1}{x}
\]
| Alternative 3 |
|---|
| Accuracy | 98.7% |
|---|
| Cost | 13760 |
|---|
\[\frac{1}{\left(1 + x\right) \cdot \left(x \cdot \left({x}^{-0.5} + {\left(1 + x\right)}^{-0.5}\right)\right)}
\]
| Alternative 4 |
|---|
| Accuracy | 98.7% |
|---|
| Cost | 13508 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 106000000:\\
\;\;\;\;{x}^{-0.5} - {\left(1 + x\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)}\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 90.7% |
|---|
| Cost | 7428 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.2:\\
\;\;\;\;{x}^{-0.5} + \frac{-1}{1 + x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{-1}{1 + x}}{-x}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 89.9% |
|---|
| Cost | 7364 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.2:\\
\;\;\;\;{x}^{-0.5} + \frac{-1}{1 + x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x + x \cdot x}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\end{array}
\]
| Alternative 7 |
|---|
| Accuracy | 90.7% |
|---|
| Cost | 7364 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.2:\\
\;\;\;\;{x}^{-0.5} + \frac{-1}{1 + x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{-1}{x}}{-1 - x}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\end{array}
\]
| Alternative 8 |
|---|
| Accuracy | 68.3% |
|---|
| Cost | 7236 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.2:\\
\;\;\;\;{x}^{-0.5} + \frac{-1}{1 + x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.5}{-1 - x} + \frac{0.5}{x}\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Accuracy | 89.9% |
|---|
| Cost | 7236 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.68:\\
\;\;\;\;{x}^{-0.5} + \frac{-1}{1 + x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x \cdot x}}{2 \cdot \sqrt{\frac{1}{x}}}\\
\end{array}
\]
| Alternative 10 |
|---|
| Accuracy | 68.3% |
|---|
| Cost | 7172 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 5.8:\\
\;\;\;\;{x}^{-0.5} + \frac{-1}{1 + x \cdot 0.5}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x - x\right)\right) \cdot \left(\frac{1}{0.25 - x \cdot x} \cdot \left(0.5 - x\right)\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Accuracy | 68.2% |
|---|
| Cost | 7044 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.35:\\
\;\;\;\;-1 + \left({x}^{-0.5} + x \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x - x\right)\right) \cdot \left(\frac{1}{0.25 - x \cdot x} \cdot \left(0.5 - x\right)\right)\\
\end{array}
\]
| Alternative 12 |
|---|
| Accuracy | 67.9% |
|---|
| Cost | 6788 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.59:\\
\;\;\;\;{x}^{-0.5} + -1\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x - x\right)\right) \cdot \left(\frac{1}{0.25 - x \cdot x} \cdot \left(0.5 - x\right)\right)\\
\end{array}
\]
| Alternative 13 |
|---|
| Accuracy | 66.4% |
|---|
| Cost | 6660 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 0.092:\\
\;\;\;\;{x}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(x - x\right)\right) \cdot \left(\frac{1}{0.25 - x \cdot x} \cdot \left(0.5 - x\right)\right)\\
\end{array}
\]
| Alternative 14 |
|---|
| Accuracy | 22.5% |
|---|
| Cost | 1088 |
|---|
\[\left(1 + \left(x - x\right)\right) \cdot \left(\frac{1}{0.25 - x \cdot x} \cdot \left(0.5 - x\right)\right)
\]
| Alternative 15 |
|---|
| Accuracy | 7.4% |
|---|
| Cost | 704 |
|---|
\[\left(1 + \left(x - x\right)\right) \cdot \frac{1}{x + 0.5}
\]
| Alternative 16 |
|---|
| Accuracy | 7.4% |
|---|
| Cost | 192 |
|---|
\[\frac{1}{x}
\]
| Alternative 17 |
|---|
| Accuracy | 5.8% |
|---|
| Cost | 64 |
|---|
\[2
\]