IF \(Guess \times Guess \approx X\) THEN RETURN TRUE
ELSE RETURN FALSE
Improve Guess
RETURN average of \(Guess, \frac{X}{Guess}\)
The algorithm to find the square root of any positive real number X is simple. We start with a guess that 1 is square root of X. We then improve our guess by averaging guess and x/guess. If our guess was low than the actual square root then averaging step would increase our guess otherwise it would decrease our guess. By repeating this averaging step we can reach to our actual square root very fast.