def horner_formula(coefs):
    """
    A relatively efficient form to evaluate a polynomial.
    E.g.: horner_formula((10, 20, 30, 0, -50)) == 
            '(10 + x * (20 + x * (30 + x * x * -50)))',
    which is 4 multiplies and 3 adds."""
    c = coefs[0]
    if len(coefs) == 1:
        return str(c)
    else: 
        factor = 'x * ' + horner_formula(coefs[1:])
        return factor if c == 0 else '(%s + %s)' % (c, factor)