正在加载图片...
8 1 Lagrange Polynomial Lab 10. Lagrange polynomial Given a set of sample points (xo, f(xo),(u, f(xD),,(xn, f(xn))of a certain function f, use Lagrange polynomial to approximate function values at some given points Input There are several sets of inputs. For each set: The 1st line contains an integer 20>n>0 which is the degree of agrange polynomial. n=-l signals the end of file The 2nd line contains n+l distinct real numbers xo,x,,x The 3rd line contains n+l real numbers f(o), f(x,),,f(n) The last line of a test case consists of an integer m>0 and m real numbers a1,…,am· The numbers are separated by spaces and new lines.§1 Lagrange Polynomial Lab 10. Lagrange Polynomial Given a set of sample points of a certain function f , use Lagrange polynomial to approximate function values at some given points . Input There are several sets of inputs. For each set: The 1st line contains an integer 20  n  0 which is the degree of Lagrange polynomial. n = -1 signals the end of file. The 2nd line contains n+1 distinct real numbers . The 3rd line contains n+1 real numbers . The last line of a test case consists of an integer m > 0 and m real numbers . The numbers are separated by spaces and new lines. ( , ( )), ( , ( )), ..., ( , ( )) 0 0 1 1 n xn x f x x f x x f m a , ... , a 1 n x , x , ... , x 0 1 ( ), ( ), ... , ( ) 0 1 n f x f x f x m a , ... , a 1
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有