Polynomial evaluation and differentiation for cuda