我自己写的数值分析课程设计的算法
源代码在线查看: lagrange.txt
x | sin(x) | l1 | E1
0.07853982 0.07845910 0.07821723 0.000242
0.23561945 0.23344536 0.23272573 0.000720
0.39269908 0.38268343 0.38150375 0.001180
0.54977871 0.52249856 0.52088788 0.001611
0.70685835 0.64944805 0.64744602 0.002002
0.86393798 0.76040596 0.75806189 0.002344
1.02101761 0.85264016 0.85001176 0.002628
1.17809724 0.92387953 0.92103152 0.002848
1.33517688 0.97236992 0.96937243 0.002997
x | sin(x) | l2 | E2
0.07853982 0.07845910 0.07869872 0.000240
0.23561945 0.23344536 0.23367686 0.000231
0.39269908 0.38268343 0.38290109 0.000218
0.54977871 0.52249856 0.52269703 0.000198
0.70685835 0.64944805 0.64962243 0.000174
0.86393798 0.76040596 0.76055197 0.000146
1.02101761 0.85264016 0.85275420 0.000114
1.17809724 0.92387953 0.92395879 0.000079
1.33517688 0.97236992 0.97241245 0.000043