Polynomial functional calculus