Condition of square root algorithm (Newton's method) I am reading the book Algorithm 4th and see this square root algorithm using Newton's method (java sample code):

public static double sqrt(double c)
{
    if (c &lt; 0) return Double.NaN;
    double err = 1e-15;
    double t = c;
    while (Math.abs(t - c/t) &gt; err * t)
        t = (c/t + t) / 2.0;
    return t;
}


I wanna know what's the rule behind the while loop condition,  

Math.abs(t - c/t) &gt; err * t   

Why is it (|t-c/t|)/t &gt; err?
For exmaple, can't the condition simply be  |t-c/t| &gt; err?

I know that, t-c/t -> 0 when loop count -> ∞.

I remember that I encouter many "manually choose approximation condition" when learn Probability Theory. But now I totally forget it. So any related,basic background knowledge explanation or introduction would be much appreciated. 



Newton's method from my original math textbook:

$$ a&gt;0, x_0&gt;0, \\ \{X_n\}: X_n = \frac{1}{2}(x_{n-1} + \frac{a}{x_{n-1}}) \\ \lim{x_n} = \sqrt{a}\ $$
Try calculating the square root if 1e-100 with the changed loop condition and see what result you get. Then try calculating the square root of 1e100. Do you run into any problems?

This is numerical mathematics, limits won’t work well. Print out the value of t -c/t and check whether it actually converges, and check if it converges to 0. For some different values if c.

From a wiser man than me: The problem are not the things we don’t know. The problem are the things we know that ain’t so.