Which is the correct relative error?
$$
r_1=\frac{|p_n-p|}{|p_n|}
$$
or
$$
r_2=\frac{|p-p_n|}{|p|}
$$
Asked
Active
Viewed 92 times
0
Dante
- 1,908
-
See here. – Mårten W Sep 23 '13 at 17:20
2 Answers
0
Given some value $u$ and its approximation $u_{approx}$ the definition of elative error is $$\frac{|u-u_{approx}|}{|u|}$$ So if your $p_n$ is the approximation of $p$ in your question the relative error is $r_2$
Ömer
- 2,038
0
Assuming $p$ is the exact solution and $p_n$ is a numerical approximation, the absolute and relative errors are defined as $$\text{err}_\text{abs} := |p_n-p|$$ and $$\text{err}_\text{rel} := \frac{\text{err}_\text{abs}}{|p|} = \frac{|p_n-p|}{|p|}$$ So $r_2$ is correct.
AlexR
- 24,905
-
Thank you. But why does Brian Bradie in A Friendly Introduction to Numerical Analysis on the topic of rootfinding methods write the first stopping condition? – Dante Sep 23 '13 at 17:52
-
Basically, as $p_n\to p$, $r_1\to r_2$. It might be easier to compute the error (i.e. faster) or sufficient... – AlexR Sep 23 '13 at 19:00