%Numerische Berechnung der Verteilungsfunktion der Normalverteilung ueber
%die Simpson-Regel
function y = int_simpson(x,N)

%integration parameters
int_lowerbound = -8;
int_upperbound = x;
int_n = N;

h = (int_upperbound-int_lowerbound)/(2*int_n);
x = int_lowerbound:h:int_upperbound;

%Simpson-Regel
S = 0;
S = f(x(1))+4*f(x(2))+f(x(length(x)));
for i=1:int_n-1
    S = S+2*(f(x(2*i+1))+2*f(x(2*i+2)));
end
S = S*h/3;

y = S;