Complex root criteria in xroots()
In the xroots() code on p367 of NRIF, a complex root x = a + bi is forced real if |b| <= 2*eps**2*|a|. I cannot derive this from a few different assumptions; the closest I can come is b^2 <= 2*eps*|a|, assuming that the root is forced real if |x| - |a| <= eps.
How is this criteria derived?
Thanks for any help.
Saul Teukolsky
07-13-2002, 10:59 PM
Hi Doug,
The criterion in the Recipe, using eps**2, is purely empirical. After all, you may well have a root that has a very small imaginary part that is meaningful. But your criterion, with eps, is perfectly reasonable to use instead. It assumes that any small imaginary part cannot be determined with an accuracy better than eps relative to the real part.
Hi Saul,
Thanks a lot for your quick reply. I've been thinking about this for a while - I wish I would have asked sooner!
I also wanted to let you know that I've been happily using NRIF for many years, now, and it tends to be the first book I grab when I need to learn how to do something new. The code for the special functions is particularly helpful.
Finally, I really appreciate your setting up this forum.
thanks again,
Doug