def my_sqrt(a):
    """
    In general:
    Takes number, a, that you want the square root of, and an estimate,
    x, and outputs the closest approximation to the true square root that can be
    found via Newton's algorithm.

    Specifically: 
    Takes argument a, the value you want to take a square root of, and x, the first
    estimate you have for the square root. Evaluates x and a according to Newton's
    algorithm for finding square roots (Downey, 2015), updates the estimate to a
    closer approximation, and checks if the approximation provided by the algorithm
    is equivalent to the last approximation. If true, stop the program and move on
    to the next statement. Otherwise, continue the loop. 
    """
    # Initializes x and sets the estimate as half of a. 
    x = a/2
    while True:
        y = (x + a/x) / 2.0
        if y == x:
            break
        x = y
    # Returns final value of x. 
    return x