MCPcopy Index your code
hub / github.com/evalplus/evalplus / _poly

Function _poly

evalplus/eval/_special_oracle.py:50–55  ·  view source on GitHub ↗

Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n

(xs: list, x: float)

Source from the content-addressed store, hash-verified

48
49# oracle for HumaneEval/032
50def _poly(xs: list, x: float):
51 """
52 Evaluates polynomial with coefficients xs at point x.
53 return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
54 """
55 return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)])

Callers 1

unsafe_executeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected