
exakt=4/3*sqrt(2)
mittelp=2
trapez=sqrt(2)
simpson=4/3+1/3*sqrt(2)

gauss1=2*sqrt(0 + 1)
gauss2=1*sqrt( -sqrt(1/3) + 1 )   + 1*sqrt( sqrt(1/3) + 1 )
gauss3=5/9*sqrt( -sqrt(3/5) + 1 ) + 8/9*sqrt( 0 + 1 ) + 5/9*sqrt( sqrt(3/5) + 1 ) 


function doprint(name,wert,ex)
printf(' %s  %f %9f \n',name,wert,ex-wert)
end

printf(' Formel           Wert     Fehler \n');
printf(' ====================================\n');
doprint('Mittelp.-regel',mittelp,exakt)
doprint('Trapezregel   ',trapez,exakt)
doprint('Simpsonregel  ',simpson,exakt)
doprint('Gauss n=1     ',gauss1,exakt)
doprint('Gauss n=2     ',gauss2,exakt)
doprint('Gauss n=3     ',gauss3,exakt)

