def maclaurin_cot(value, k):
    """
    Compute maclaurin's series approximation for tan-1(x)
    """
    global first_value    
    first_value = 0.0
    
    #attempt to Approximate tan-1(x) for a given value 
    try:
        error(value)
        for item in xrange(1,k,4):
            next_value = value**item/float(item)
            first_value += next_value
            
        for arg in range(3,k,4):
            next_value = -1* value **arg/float(arg)
            first_value += next_value
            
        return round(first_value*180/pi,2)
    
    #Raise TypeError if input is not within
    #the interval of convergence
    except TypeError,exception:
        print exception

    Compute maclaurin's series approximation for tan-1(x)
    
recipes/Python/577289_Maclaurinsseriestan1/recipe-577289.py