function short()

disp('Question 1')
eulers()

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

disp('Question 2')
x=1.2;
normal(x)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

disp('Question 3')
a = [ 4.16, 0, 0, 0;
     -3.12, 5.03, 0, 0;
      0.56, -0.83, 0.76, 0;
     -0.1, 1.18, 0.34, 1.18];
b = [  8.699999999999999, 8.300000000000001;
     -13.35, 2.13;
       1.89, 1.61;
      -4.14, 5];

posdef_solve(a,b)  

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

disp('Question 4')
n = nag_int(1000);
genid = nag_int(1);
subid = nag_int(1);
x = zeros(n,1);
y = zeros(n,1);
   
a = 0; b = 2;
[state, ifail] = g05kg(genid, subid);
[state, x, ifail] = g05sk(n, a, b^2, state);
[state, y, ifail] = g05sk(n, a, b^2, state);
plot(x,y,'o')
xlim([-8,8])
ylim([-8,8])
hold on

a = -6; b = 6;
[state, ifail] = g05kg(genid, subid);
[state, x, ifail] = g05sq(n, a, b, state);
[state, y, ifail] = g05sq(n, a, b, state);
plot(x,y,'r+')
hold off

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

disp('Question 5')
clear pi
a = 0; b= pi; acc = 1e-5;
[area, npts, relerr, ifail] = d01ah(a, b, acc, @sin, nag_int(0))

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

disp('Question 6')
u = 1; r = -6; s = 11; t = -6;
[zeror, zeroi, errest, ifail] = c02ak(u, r, s, t)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

disp('Question 7')
a=rand(6); a=a+a';
eig(a)'
[a, m, w, z, isuppz, info] = f08fd('N', 'V', 'U', a, 0.0, 1000.0, ... 		     
                                    nag_int(1), nag_int(2), -1)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Called functions:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function result = eulers()
    [result] = x01ab;
    
function result = normal(x)
    [result, ifail] = s15ab(x);
    
function x = posdef_solve(a,b)
    % Function assumes lower triangle given
    % Note we should check the value of info for errors
    uplo = 'L';
    [aa, info] = f07fd(uplo, a);
    [x, info] = f07fe(uplo, aa, b);
    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


    
