Lambda function for polynomial evaluation.