Recursive implementation of square root algorithm