Relative error between a real and complex number.

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 6K views
Pacopag
Messages
193
Reaction score
4

Homework Statement


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
[tex]rel.err. = {{x1-x2}\over{x1}}[/tex].
But what do I do if x1 is real and x2 is complex?


Homework Equations





The Attempt at a Solution

 
Physics news on Phys.org
Pacopag said:

Homework Statement


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
[tex]rel.err. = {{x1-x2}\over{x1}}[/tex].
But what do I do if x1 is real and x2 is complex?


Homework Equations





The Attempt at a Solution


mabye try
[tex] \frac{|x_1-x_2|}{x_1}[/tex]
 
Yes. That makes sense. It is the distance between the two values. Works in the complex plane too. Thanks.