import numpy as np
if __name__ =='__main__':
X =[0.0,0.1,0.195,0.3,0.401,0.5]
Y =[0.39894,0.39695,0.39142,0.38138,0.36812,0.35206]
x =float(input())
L =0.0
n =len(Y)for k inrange(n):
l = Y[k]for j inrange(n):if j != k:
l = l *(x - X[j])/(X[k]- X[j])
L = L + l
print(np.round(L,5))
import numpy as np
if __name__ =='__main__':
X = np.array(input().split(" "))
Y = np.array(input().split(" "))
X = X.astype(float)
Y = Y.astype(float)
x =float(input())
n =len(Y)
DQ = np.zeros((n, n))for i inrange(n):
DQ[i][0]= Y[i]for i inrange(1, n):for j inrange(0, n):if j+i < n:
DQ[j][i]=(DQ[j][i-1]- DQ[j+1][i-1])/(X[j]- X[j+i])
N1 =0.0for i inrange(0, n):
a = DQ[0][i]for j inrange(0, i):
a = a *(x - X[j])
N1 = N1 + a
for i inrange(n):for j inrange(n):print(format(DQ[i][j],'.5f'), end=' ')print()print(format(N1,'.5f'))
DC = np.zeros((n, n))for i inrange(n):
DC[i][0]= Y[i]for i inrange(1, n):for j inrange(0, n):if j+i < n:
DC[j][i]=(DC[j+1][i-1]- DC[j][i-1])
h = X[1]- X[0]
t =(x - X[0])/ h
N2 =0.0for i inrange(0, n):
r = DC[0][i]for j inrange(0, i):
r = r *(t-j)
r = r / np.math.factorial(i)
N2 = N2 + r
for i inrange(n):for j inrange(n):print(format(DC[i][j],'.5f'), end=' ')print()print(format(N2,'.5f'))
import numpy as npif __name__ == '__main__': X = [0.0, 0.1, 0.195, 0.3, 0.401, 0.5] Y = [0.39894, 0.39695, 0.39142, 0.38138, 0.36812, 0.35206] x = float(input()) L = 0.0 n = len(Y) for k in range(n): l = Y[k] for j