import numpy as np
p = np.polynomial.Chebyshev.interpolate(f, degree, domain=(xmin, xmax))
# insert your code to print out some C code
Also strongly recommend some basic familiarity with the theory. Approximating `Math.abs(x)` to even a few digits of uniform accuracy on any interval containing 0 requires tens if not hundreds of thousands of coefficients.