Find a function which is both well and ill-conditioned depending on the argument

112 Views Asked by At

I need to find an example of a differentiable function $f: \mathbb{R} \rightarrow \mathbb{R}$, such that for $x_1, x_2$ we get for the absolute and relative condition $K_{abs}(f, x_1)$ is high, $K_{rel}(f, x_1)$ is low and $K_{abs}(f, x_2)$ low, $K_{rel}(f, x_2)$ is high. It should not be the function $f(x) = 1-\sqrt{x}.$ I tried different options, but could not get the result. We set $K_{abs}(f, x):= |f'(x)|, K_{rel}(f, x) := \frac{|x|}{|f(x)|}K_{abs}.$ Any help is appreciated. Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

Let $f : \mathbb{R} \rightarrow \mathbb{R}$ be given by $f(x) = \exp(x)$. Then $$ \kappa_{\text{rel}}(f,x) = |x|$$ and $$\kappa_{\text{abs}}(f,x) = \exp(x).$$ Now what is a large condition number? This is very context dependent and the question cannot be answered unless we consider the accuracy that is required by the underlying application as well as the hardware that is available. This answer adds a few more words to that issue. In our current situation there is of course no physical application/context and we can afford to be somewhat arbitrary. At $x_1 = -10^{12}$ the absolute condition number of $f$ is utterly insignificant and the computer's representation of that number is literally $0$. In contrast, the relative condition number of $f$ is so large that we cannot expect more that 4 correct significant digits when computing $f(y)$ for $y \approx x_1$ using IEEE double precision arithmetic for which the unit roundoff is $$u = 2^{-53} \approx 1.1 \times 10^{-16}.$$ At $x_2=1000$, the true value of absolute condition number of $f$ vastly exceeds the representational range of IEEE double precision. In contrast, the relative condition number is still modest compared with the unit roundoff and we expect 12 significant figures when computing $f(y)$ for $y \approx x_2$.

Many texts focus on the case where $f$ is differentiable and some text will even use the formulas that allow us to computed condition numbers as the actual definition of said condition numbers. This makes for fast writing, but obfuscates the fact that condition numbers represent the limit of the worst behavior of the function $f$. This answer to a related question discusses the issue.