Polynomial should extend Double=>Double function type.