Evaluating a math function with two arguments in Python