Relative Condition Number for $\sqrt{x+1}-\sqrt{x}$

408 Views Asked by At

For a numerics problem, I have to find whether the function in the header is well-conditioned for large x with relative conditioning. In my understanding, I have to find the limit for x->inf of $\frac{x}{\sqrt{x+1}-\sqrt{x}}*\frac{d}{dx}\sqrt{x+1}-\sqrt{x}$. However, I cannot really calculate this limit on paper.

Is my approach right? How can I calculate the limit?

Also, for a follow up problem, I have to find a numerically stable realization of the function - how would I do that?

Thank you very much!

1

There are 1 best solutions below

0
On

Let $f : (0, \infty) \rightarrow \mathbb{R}$ be given by $$f(x) = (1+x)^{\frac{1}{2}} - x^{\frac{1}{2}}.$$ Then $f$ is differentiable and $$f'(x) = \frac{1}{2} (1+x)^{-\frac{1}{2}} - \frac{1}{2} x^{-\frac{1}{2}}.$$ It follows that $$ \frac{x f'(x)}{f(x)} = \frac{1}{2} x\frac{(1+x)^{-\frac{1}{2}} - x^{-\frac{1}{2}} }{(1+x)^{\frac{1}{2}} - x^{\frac{1}{2}}} = \frac{1}{2} x \frac{t^{-1} - s^{-1}}{t-s}, $$ where we have introduced $$t = (1 + x)^\frac{1}{2}, \quad s = x^{\frac{1}{2}}.$$ It follows that $$ \frac{x f'(x)}{f(x)} = -\frac{1}{2}x \frac{1}{ts} = - \frac{1}{2} \frac{x^\frac{1}{2}}{(1+x)^\frac{1}{2}} = -\frac{1}{2} \sqrt{\frac{x}{1+x}}. $$ We conclude that $f$ is exceedingly well-conditioned in the relative sense and if $\kappa_f(x)$ denotes the relative condition number of the function $f$ at the point $x$, then $$\underset{x \rightarrow \infty}{\lim} \kappa_f(x) = \frac{1}{2}.$$ The difficulty associated with evaluating $f$ is an artifact of the cancellation that will almost certainly occur for large values of $x$. This problem can be addressed using, say, Taylor expansions. For example, since $$(1 + x) = x(1 + x^{-1})$$ we have $$(1+x)^\frac{1}{2} \approx x^{\frac{1}{2}} \left( 1 + \frac{1}{2} x^{-1} \right).$$ It follows that $$f(x) \approx \frac{1}{2} x^{-\frac{1}{2}}$$ is a good approximation for all sufficiently large $x$. It would be entirely proper to investigate when more terms are needed and when $x$ is sufficiently large, but perhaps these are questions for another day.