
function y=f(x)
    y=4.0./(1+x.^2);
 endfunction

function z=rectangle(n) 
    x0=0:n-1;                  
    x=x0/n;        
      s=0.0
      for i=x;  
        s=s+f(i+1/(2*n))/n;
      end;      
    z=s           
endfunction
