I used lagrangian interpolation and for some equations the average value of the function is astronomical despite the polynomial and the points it interpolates.
For example
Polynomial A:
$$(X_0, Y_0) = (62,181)\\ (X_1, Y_1) = (40,210)\\ (X_2, Y_2) = (67,185)\\ (X_3, Y_3) = (19, 201)\\ (X_4, Y_4) = (41, 199) $$
Lagrangian Polynomial:
$$f(x)=-3893/4980690 x^4+5847/39130x^3-353200229/34864830x^2+121372073/430430x-8446030382/3486483$$
The average value of the function within $19\le x\le 67: 5248520$
Polynomial B:
$$(X_0, Y_0) = (1,200)\\ (X_1, Y_1) = (81,250)\\ (X_2, Y_2) = (32,212)\\ (X_3, Y_3) = (77, 248)\\ (X_4, Y_4) = (93, 245) $$
$$f(x)=-1173601/155489214720 x^4+28814081/22212744960 x^3-1451597501/22212744960 x^2+3639509257/2549003520 x+1482612997/7463960$$
$$dx=32773432105907/145771138800≈224.8$$
Am I doing something wrong in polynomial A. What is mathematically the cause for this? Thanks!
The average value of the function within 19<=x<=67: 5248520: this is not what I see – Dmitry Aug 01 '20 at 23:265248520is a large number. It won't lead to any numerical problems unless you need something like the $7$-th digit after decimal point, e.g. depending on your calculator $((5248520 + 10^{-10}) - 5248520) \cdot 10^{10}$ may be something like 0 instead of 1. of course, you may use it to get even bigger numbers. They may lead to problems. – Dmitry Aug 01 '20 at 23:46