degree_4: Improving speed of polynomial's degree()

Added test cases in docstring. Previous Travis CI ended up with an error due to a time exceeding.