def halve_degree(coeffs, verbose=False):
coeffs.reverse()<EOL>l = len(coeffs)<EOL>new = [None for i in range(l)]<EOL>for i in range(l-<NUM_LIT:1>, -<NUM_LIT:1>, -<NUM_LIT:1>):<EOL><INDENT>new[i] = coeffs[i] <EOL>k = <NUM_LIT:0> <EOL>for j in range(i, -<NUM_LIT:1>, -<NUM_LIT:2>):<EOL><INDENT>coeffs[j] -= new[i] * binomial(i, k)<EOL>k += <NUM_LIT:1><EOL><DEDENT>if verbose: print(coeffs) <EOL><DEDENT>return new<EOL>
Takes a list of coefficients, index corresponding to power as usual.
The list is assumed to be the coeffs from 0 to deg/2 + 1.