Created
January 28, 2020 12:52
-
-
Save tjmtmmnk/2ceeb60986c8d146d590f660c8e561f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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