Skip to content

Instantly share code, notes, and snippets.

@tjmtmmnk
Created January 28, 2020 12:52
Show Gist options
  • Save tjmtmmnk/2ceeb60986c8d146d590f660c8e561f6 to your computer and use it in GitHub Desktop.
Save tjmtmmnk/2ceeb60986c8d146d590f660c8e561f6 to your computer and use it in GitHub Desktop.
def f(x):
return 1234 + 166 * x + 94 * x * x
x = [2,4,5]
f0 = 0
for j in range(3):
prod = 1
for m in range(3):
if m != j:
prod *= (x[m] / (x[m] - x[j]))
f0 += f(x[j]) * prod
print(f0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment