# Condition number of an algorithm

I am stuck with a problem about finding the condition number of an algorithm. I tried to find an example, but i couldn't. Can anybody help me, please?

Given is $f(x)=\ln(x)$. We have the algorithm $f_{A}(x)=[\ln(x)](1+\varepsilon )$, where $\left | \varepsilon \right |\leq 5\mathrm{eps}$ and $\mathrm{eps}$ is the machine epsilon. What could be said about the condition number of this algorithm?

Well, i know that $x\in \mathbb{R}_{m}^{M}$ (the set of the machine numbers) there exists an $x_{A}$ such that $f_{A}(x)=f(x_{A})$. I also know that the condition number of an algorithm we compute with $\mathrm{cond}_{A}(f)= \mathrm{inf} \left \{\frac{\left \| x- x_{A} \right \|}{\left \| x \right \| \mathrm{eps}} \right \}$. The problem is how to find this $x_{A}$?

Can anybody help me with this problem, please? Thank you in advance!

• Is this a homework question? – Paul Mar 9 '14 at 16:06
• Can you state how you define the condition number of an algorithm (I assume that you equate "algorithm" and "function" here)? – Wolfgang Bangerth Mar 9 '14 at 17:04
• Yes, i equate algorithm and function here. – CryptoBeginner Mar 9 '14 at 17:34
• That is not a good idea. Say, for a function you might have multiple different algorithms. – shuhalo Mar 11 '14 at 0:01

## 1 Answer

$$cond(f) = \frac{x f'(x)}{f(x)}$$

so for $f(x) = ln(x)(1+\epsilon)$ that's

$$\frac{x (1/x)(1+\epsilon)}{ln(x)(1+\epsilon)} = \frac{1}{ln(x)}$$

and as Martin stated, don't use "algorithm" and "function" interchangeably.