[Math] What should the initial guess be for the Babylonian method of calculating square roots

numerical methodsradicals

You can use any value as the initial guess for the Babylonian method of calculating a square root (other than 0), but the closer the guess to the root, the more accurate your result per iteration.

Of course you cannot expect to use the correct root as the initial guess, otherwise you've already solved the problem.

But I am wondering what simple method I could use to approximate the initial value? For example, I could use (number / 2), but there is probably a better method?

Best Answer

The point is that once you get close, you double the number of significant figures each iteration. You quickly get the precision you need. The best way to get the initial value depends on what format you get the number to take the square root of in. If you get a computer value with binary exponent and mantissa, you can just cut the exponent in half. That will be within a factor $\sqrt 2$ of the correct value. If you just get a real number, dividing by $2$ only helps when the number is greater than $\sqrt 2$, otherwise it hurts. Whether this is a good trade depends on the probability distribution of the numbers you are asked to take the square root of. If you think you will get preferentially small numbers (less than $\sqrt 2)$ you should just take the supplied number as the first guess.