def maclaurin_cosh_inverse(value, k):
    """
    Compute maclaurin's series approximation for cosh-1(value).
    """
 
    global first_value    
    first_value = 0.0
    
    #attempt to Approximate cosh-1(x) for a given value    
    try:
        value_y = value + sqrt(value**2-1)
        value_x = (value_y -1)/float(value_y + 1)
        for item in xrange(1,k,2):
            next_value = value_x **item/item
            first_value += next_value

        return 2*(first_value)
    
    #Raise TypeError if input is not a number   
    except TypeError:
        print 'Please enter an integer or a float value'

    Compute maclaurin's series approximation for cosh-1(value).
    
recipes/Python/577400_Maclaurinsseriescosh1x/recipe-577400.py