The Orbit Intersection Problem and Polynomial Functions