function porovnaniGaussovyASlozenychNewtonCotesovychKvadratur(f,a,b)

load GaussLegendreQuadrature

for i=1:8
    NN(i) = orders{i};
end
for N=1:8
    IN0(N) = slozeneObdelnikovePravidlo(f,a,b,N);
    IN1(N) = slozeneLichobeznikovePravidlo(f,a,b,N);
    IN2(N) = slozeneSimpsonovoPravidlo(f,a,b,N);
    INGL(N) = ((b-a)/2)*weights{N} * feval(f,(a+b)/2+((b-a)/2)*points{N})';
end
I = ((b-a)/2)*weights{19} * feval(f,(a+b)/2+((b-a)/2)*points{19})';

plot(log10(NN),log10(abs(I-IN0)),'r',...
    log10(NN),log10(abs(I-IN1)),'k',...
    log10(NN),log10(abs(I-IN2)),'m',...
    log10(NN),log10(abs(I-INGL)),'g',...
    log10(NN),log10(NN.^(-2)),'r--',...
    log10(NN),log10(NN.^(-4)),'m--',...
    log10(NN),log10(10.^(-NN)),'g--')
xlabel('log(N)')
ylabel('log|I-I_N|')
legend('sloz. obdelnik.','sloz. lichobeznik.','sloz. Simpson.',...
    'Gauss-Legendre','O(N^{-2})','O(N^{-4})','O(10^{-N})')