_special_oracle.py
1 """Special oracle handlings for problems where direct differential testing is not applicable.""" 2 3 import math 4 5 # oracle for HumaneEval/032 6 def _poly(xs: list, x: float): 7 """ 8 Evaluates polynomial with coefficients xs at point x. 9 return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n 10 """ 11 return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)])