PDA

View Full Version : relative error between a real and complex number.


Pacopag
Nov23-08, 03:50 PM
1. The problem statement, all variables and given/known data
So I've got a polynomial with real roots. It turns out that if you perturb one of the coefficients by a small amount, two of the roots end up in the complex plane. Now I want to find the relative error in my computation. For two real numbers, say x1 and x2, I would take
rel.err. = {{x1-x2}\over{x1}}.
But what do I do if x1 is real and x2 is complex?


2. Relevant equations



3. The attempt at a solution

olgranpappy
Nov23-08, 07:52 PM
1. The problem statement, all variables and given/known data
So I've got a polynomial with real roots. It turns out that if you perturb one of the coefficients by a small amount, two of the roots end up in the complex plane. Now I want to find the relative error in my computation. For two real numbers, say x1 and x2, I would take
rel.err. = {{x1-x2}\over{x1}}.
But what do I do if x1 is real and x2 is complex?


2. Relevant equations



3. The attempt at a solution

mabye try

\frac{|x_1-x_2|}{x_1}

Pacopag
Nov23-08, 08:25 PM
Yes. That makes sense. It is the distance between the two values. Works in the complex plane too. Thanks.