Hello, I am looking for the estimation error of Simpson's rule of thirds. When dx is 1.01, the integral value is 2908800 and the error is 0.01, but the estimation error is 7.0844e-21. Where did it go wrong? I think In this part, the 5th coefficient is verry verry small, so it seems that the value will always be low. Isn't the estimation error always accurate?
clc; clear all; close all;
a = -1.93317553181561E-24;
b = 3.788630291530091e-21;
c = -2.3447910280083294e-18
d = -0.019531249999999518;
fun = @(t) a.*t.^5 + b.*t.^4 + c.*t.^3 + d.*t.^2+e.*t
plot(x, fx,'k','linewidth',2);
area_temp = dx/6*(fx_left +4*fx_mid+fx_right);
x_segment = linspace(i-1, i,100);
Px = fx_left * ((x_segment-mid).*(x_segment-i))/((i-1-mid)*(i-1-i))...
+ fx_mid*((x_segment-i+1)).*(x_segment-i)/((mid-i+1)*(mid-i))...
+ fx_right * ((x_segment-i+1).*(x_segment-mid))/((i-i+1)*(i-mid));
area(x_segment,Px); hold on;
E_a = -((960.^5)/(2880.*(960/1.01).^4)).*(a.*120.*C+24.*b);
rel_error=norm(int_true-int)/norm(int_true);