function [ x, w ] = gqu2 ( n )

%*****************************************************************************80
%
%% gqu2() provides data for Gauss quadrature with a uniform weight.
%
%  Discussion:
%
%    This data assumes integration over the interval [0,1] with 
%    weight function w(x) = 1.
%
%    This is a revision of GQU.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 April 2014
%
%  Author:
%
%    John Burkardt.
%
%  Reference:
%
%    Florian Heiss, Viktor Winschel,
%    Likelihood approximation by numerical integration on sparse grids,
%    Journal of Econometrics,
%    Volume 144, 2008, pages 62-80.
%
%  Input:
%
%    integer N, the number of points and weights.
%    1 <= N <= 25.
%
%  Output:
%
%    real X(N), the nodes.
%
%    real W(N), the weights.
%
  if ( n == 1 )
    x = [ 0.500000000000000000 ];
    w = [ 1.000000000000000000 ];
  elseif ( n == 2 )
    x = [ 0.211324865405187134; ...
          0.788675134594812866];
    w = [ 0.500000000000000000; ...
          0.500000000000000000 ];
  elseif ( n == 3 )
    x = [ 0.112701665379258298; ...
          0.500000000000000000; ...
          0.887298334620741702];
    w = [ 0.277777777777777124; ...
          0.444444444444445697; ...
          0.277777777777777124 ];
  elseif ( n == 4 )
    x = [ 0.0694318442029737692; ...
          0.330009478207571871; ...
          0.669990521792428129; ...
          0.930568155797026231];
    w = [ 0.173927422568724843; ...
          0.326072577431275157; ...
          0.326072577431275157; ...
          0.173927422568724843 ];
  elseif ( n == 5 )
    x = [ 0.0469100770306680737; ...
          0.230765344947158502; ...
          0.500000000000000000; ...
          0.769234655052841498; ...
          0.953089922969331926 ];
    w = [ 0.118463442528091739; ...
          0.239314335249685012; ...
          0.284444444444446554; ...
          0.239314335249685012; ...
          0.118463442528091739 ];
  elseif ( n == 6 )
    x = [ 0.033765242898423975; ...
          0.169395306766867648; ...
          0.380690406958401506; ...
          0.619309593041598494; ...
          0.830604693233132352; ...
          0.966234757101576025 ];
    w = [ 0.0856622461895818338; ...
          0.180380786524070719; ...
          0.233956967286347461; ...
          0.233956967286347461; ...
          0.180380786524070719; ...
          0.0856622461895818338 ];
  elseif ( n == 7 )
    x = [ 0.0254460438286208124; ...
          0.12923440720030277; ...
          0.297077424311301463; ...
          0.500000000000000000; ...
          0.702922575688698537; ...
          0.87076559279969723; ...
          0.974553956171379188 ];
    w = [ 0.0647424830844317012; ...
          0.139852695744639349; ...
          0.190915025252560905; ...
          0.2089795918367362; ...
          0.190915025252560905; ...
          0.139852695744639349; ...
          0.0647424830844317012 ];
  elseif ( n == 8 )
    x = [ 0.0198550717512319119; ...
          0.101666761293186525; ...
          0.237233795041835505; ...
          0.408282678752175054; ...
          0.591717321247824946; ...
          0.762766204958164495; ...
          0.898333238706813475; ...
          0.980144928248768088 ];
    w = [ 0.0506142681451851803; ...
          0.111190517226687935; ...
          0.156853322938944689; ...
          0.181341891689182133; ...
          0.181341891689182133; ...
          0.156853322938944689; ...
          0.111190517226687935; ...
          0.0506142681451851803 ];
  elseif ( n == 9 )
    x = [ 0.0159198802461869571; ...
          0.0819844463366821152; ...
          0.193314283649704821; ...
          0.337873288298095487; ...
          0.500000000000000000; ...
          0.662126711701904513; ...
          0.806685716350295179; ...
          0.918015553663317885; ...
          0.984080119753813043 ];
    w = [ 0.0406371941807845832; ...
          0.0903240803474292531; ...
          0.130305348201468441; ...
          0.156173538520002264; ...
          0.165119677500630752; ...
          0.156173538520002264; ...
          0.130305348201468441; ...
          0.0903240803474292531; ...
          0.0406371941807845832 ];
  elseif ( n == 10 )
    x = [ 0.0130467357414141283; ...
          0.0674683166555076763; ...
          0.160295215850487782; ...
          0.283302302935376393; ...
          0.42556283050918442; ...
          0.57443716949081558; ...
          0.716697697064623607; ...
          0.839704784149512218; ...
          0.932531683344492324; ...
          0.986953264258585872 ];
    w = [ 0.0333356721543420012; ...
          0.0747256745752905988; ...
          0.109543181257991576; ...
          0.13463335965499873; ...
          0.147762112357377129; ...
          0.147762112357377129; ...
          0.13463335965499873; ...
          0.109543181257991576; ...
          0.0747256745752905988; ...
          0.0333356721543420012 ];
  elseif ( n == 11 )
    x = [ 0.010885670926971569; ...
          0.0564687001159522861; ...
          0.134923997212975322; ...
          0.240451935396594152; ...
          0.365228422023827548; ...
          0.500000000000000000; ...
          0.634771577976172452; ...
          0.759548064603405848; ...
          0.865076002787024678; ...
          0.943531299884047714; ...
          0.989114329073028431 ];
    w = [ 0.0278342835580849164; ...
          0.0627901847324526252; ...
          0.0931451054638675197; ...
          0.11659688229599563; ...
          0.131402272255123881; ...
          0.136462543388950863; ...
          0.131402272255123881; ...
          0.11659688229599563; ...
          0.0931451054638675197; ...
          0.0627901847324526252; ...
          0.0278342835580849164 ];
  elseif ( n == 12 )
    x = [ 0.00921968287664043373; ...
          0.0479413718147625456; ...
          0.115048662902847654; ...
          0.206341022856691314; ...
          0.316084250500909936; ...
          0.437383295744265488; ...
          0.562616704255734512; ...
          0.683915749499090064; ...
          0.793658977143308686; ...
          0.884951337097152346; ...
          0.952058628185237454; ...
          0.990780317123359566 ];
    w = [ 0.0235876681932543145; ...
          0.0534696629976592758; ...
          0.0800391642716734436; ...
          0.101583713361533282; ...
          0.116746268269177805; ...
          0.124573522906701886; ...
          0.124573522906701886; ...
          0.116746268269177805; ...
          0.101583713361533282; ...
          0.0800391642716734436; ...
          0.0534696629976592758; ...
          0.0235876681932543145 ];
  elseif ( n == 13 )
    x = [ 0.00790847264070593248; ...
          0.0412008003885109275; ...
          0.0992109546333450609; ...
          0.178825330279829942; ...
          0.275753624481776649; ...
          0.384770842022432613; ...
          0.500000000000000000; ...
          0.615229157977567387; ...
          0.724246375518223351; ...
          0.821174669720170058; ...
          0.900789045366654939; ...
          0.958799199611489072; ...
          0.992091527359294068 ];
    w = [ 0.0202420023826562281; ...
          0.0460607499188643785; ...
          0.0694367551098938746; ...
          0.0890729903809732021; ...
          0.103908023768444616; ...
          0.113141590131449032; ...
          0.116275776615437407; ...
          0.113141590131449032; ...
          0.103908023768444616; ...
          0.0890729903809732021; ...
          0.0694367551098938746; ...
          0.0460607499188643785; ...
          0.0202420023826562281 ];
  elseif ( n == 14 )
    x = [ 0.00685809565159378742; ...
          0.0357825581682131855; ...
          0.0863993424651174902; ...
          0.156353547594157316; ...
          0.24237568182092295; ...
          0.340443815536055183; ...
          0.445972525646328166; ...
          0.554027474353671834; ...
          0.659556184463944817; ...
          0.75762431817907705; ...
          0.843646452405842684; ...
          0.91360065753488251; ...
          0.964217441831786815; ...
          0.993141904348406213 ];
    w = [ 0.0175597301658745736; ...
          0.0400790435798802913; ...
          0.0607592853439517105; ...
          0.0786015835790969952; ...
          0.0927691987389691608; ...
          0.102599231860648107; ...
          0.107631926731579161; ...
          0.107631926731579161; ...
          0.102599231860648107; ...
          0.0927691987389691608; ...
          0.0786015835790969952; ...
          0.0607592853439517105; ...
          0.0400790435798802913; ...
          0.0175597301658745736 ];
  elseif ( n == 15 )
    x = [ 0.0060037409897573113; ...
          0.0313633037996470243; ...
          0.0758967082947863414; ...
          0.137791134319914965; ...
          0.214513913695730585; ...
          0.302924326461218252; ...
          0.399402953001282701; ...
          0.500000000000000000; ...
          0.600597046998717299; ...
          0.697075673538781748; ...
          0.785486086304269415; ...
          0.862208865680085035; ...
          0.924103291705213659; ...
          0.968636696200352976; ...
          0.993996259010242689 ];
    w = [ 0.0153766209980574341; ...
          0.0351830237440541593; ...
          0.0535796102335861571; ...
          0.0697853389630773147; ...
          0.083134602908497196; ...
          0.0930805000077812861; ...
          0.0992157426635560391; ...
          0.101289120962780907; ...
          0.0992157426635560391; ...
          0.0930805000077812861; ...
          0.083134602908497196; ...
          0.0697853389630773147; ...
          0.0535796102335861571; ...
          0.0351830237440541593; ...
          0.0153766209980574341 ];
  elseif ( n == 16 )
    x = [ 0.00529953250417503074; ...
          0.0277124884633836999; ...
          0.0671843988060840669; ...
          0.122297795822498445; ...
          0.191061877798678115; ...
          0.270991611171386371; ...
          0.359198224610370542; ...
          0.452493745081181231; ...
          0.547506254918818769; ...
          0.640801775389629458; ...
          0.729008388828613629; ...
          0.808938122201321885; ...
          0.877702204177501555; ...
          0.932815601193915933; ...
          0.9722875115366163; ...
          0.994700467495824969 ];
    w = [ 0.0135762297058759553; ...
          0.0311267619693239538; ...
          0.0475792558412465455; ...
          0.062314485627767105; ...
          0.0747979944082885623; ...
          0.0845782596975014622; ...
          0.0913017075224620001; ...
          0.0947253052275344315; ...
          0.0947253052275344315; ...
          0.0913017075224620001; ...
          0.0845782596975014622; ...
          0.0747979944082885623; ...
          0.062314485627767105; ...
          0.0475792558412465455; ...
          0.0311267619693239538; ...
          0.0135762297058759553 ];
  elseif ( n == 17 )
    x = [ 0.00471226234279131795; ...
          0.024662239115616158; ...
          0.0598804231365070994; ...
          0.109242998051599316; ...
          0.171164420391654692; ...
          0.243654731456761531; ...
          0.324384118273061794; ...
          0.410757909252076114; ...
          0.500000000000000000; ...
          0.589242090747923886; ...
          0.675615881726938206; ...
          0.756345268543238469; ...
          0.828835579608345308; ...
          0.890757001948400684; ...
          0.940119576863492901; ...
          0.975337760884383842; ...
          0.995287737657208682 ];
    w = [ 0.01207415143427314; ...
          0.0277297646869936118; ...
          0.0425180741585896443; ...
          0.0559419235967020534; ...
          0.0675681842342628902; ...
          0.0770228805384053083; ...
          0.0840020510782251428; ...
          0.0882813526834964474; ...
          0.0897232351781034193; ...
          0.0882813526834964474; ...
          0.0840020510782251428; ...
          0.0770228805384053083; ...
          0.0675681842342628902; ...
          0.0559419235967020534; ...
          0.0425180741585896443; ...
          0.0277297646869936118; ...
          0.01207415143427314 ];
  elseif ( n == 18 )
    x = [ 0.00421741578953449547; ...
          0.022088025214301199; ...
          0.0536987667512220934; ...
          0.0981475205137384288; ...
          0.154156478469823388; ...
          0.22011458446302623; ...
          0.294124419268578685; ...
          0.374056887154247231; ...
          0.457612493479132354; ...
          0.542387506520867646; ...
          0.625943112845752769; ...
          0.705875580731421315; ...
          0.77988541553697377; ...
          0.845843521530176612; ...
          0.901852479486261571; ...
          0.946301233248777907; ...
          0.977911974785698801; ...
          0.995782584210465505 ];
    w = [ 0.0108080067632407191; ...
          0.0248572744474849679; ...
          0.0382128651274446646; ...
          0.0504710220531437159; ...
          0.061277603355739306; ...
          0.0703214573353254518; ...
          0.0773423375631328014; ...
          0.0821382418729165037; ...
          0.084571191481571939; ...
          0.084571191481571939; ...
          0.0821382418729165037; ...
          0.0773423375631328014; ...
          0.0703214573353254518; ...
          0.061277603355739306; ...
          0.0504710220531437159; ...
          0.0382128651274446646; ...
          0.0248572744474849679; ...
          0.0108080067632407191 ];
  elseif ( n == 19 )
    x = [ 0.00379657807820787951; ...
          0.0198959239325849913; ...
          0.048422048192590994; ...
          0.0886426717314285906; ...
          0.139516911332385307; ...
          0.19972734766915945; ...
          0.267714629312019503; ...
          0.341717950018185057; ...
          0.419820677179887358; ...
          0.500000000000000000; ...
          0.580179322820112642; ...
          0.658282049981814943; ...
          0.732285370687980497; ...
          0.80027265233084055; ...
          0.860483088667614693; ...
          0.911357328268571409; ...
          0.951577951807409006; ...
          0.980104076067415009; ...
          0.99620342192179212 ];
    w = [ 0.00973089411486243415; ...
          0.0224071133828498206; ...
          0.0345222713688206687; ...
          0.0457450108112251244; ...
          0.0557833227736671128; ...
          0.064376981269668232; ...
          0.0713033510868034126; ...
          0.0763830210329299597; ...
          0.0794844216969773365; ...
          0.0805272249243919463; ...
          0.0794844216969773365; ...
          0.0763830210329299597; ...
          0.0713033510868034126; ...
          0.064376981269668232; ...
          0.0557833227736671128; ...
          0.0457450108112251244; ...
          0.0345222713688206687; ...
          0.0224071133828498206; ...
          0.00973089411486243415 ];
  elseif ( n == 20 )
    x = [ 0.00343570040745255767; ...
          0.0180140363610430398; ...
          0.0438827858743370269; ...
          0.0804415140888905533; ...
          0.126834046769924602; ...
          0.181973159636742432; ...
          0.244566499024586381; ...
          0.313146955642290226; ...
          0.386107074429177466; ...
          0.461736739433251331; ...
          0.538263260566748669; ...
          0.613892925570822534; ...
          0.686853044357709774; ...
          0.755433500975413619; ...
          0.818026840363257568; ...
          0.873165953230075398; ...
          0.919558485911109447; ...
          0.956117214125662973; ...
          0.98198596363895696; ...
          0.996564299592547442 ];
    w = [ 0.0088070035695753026; ...
          0.0203007149001935561; ...
          0.0313360241670545686; ...
          0.0416383707883524329; ...
          0.0509650599086203179; ...
          0.0590972659807592476; ...
          0.0658443192245883463; ...
          0.0710480546591911871; ...
          0.0745864932363019956; ...
          0.0763766935653631129; ...
          0.0763766935653631129; ...
          0.0745864932363019956; ...
          0.0710480546591911871; ...
          0.0658443192245883463; ...
          0.0590972659807592476; ...
          0.0509650599086203179; ...
          0.0416383707883524329; ...
          0.0313360241670545686; ...
          0.0203007149001935561; ...
          0.0088070035695753026 ];
  elseif ( n == 21 )
    x = [ 0.00312391468980521836; ...
          0.0163865807168468436; ...
          0.0399503329247996586; ...
          0.0733183177083414073; ...
          0.115780018262161111; ...
          0.166430597901293886; ...
          0.224190582056390086; ...
          0.287828939896280556; ...
          0.355989341598799469; ...
          0.427219072919552412; ...
          0.500000000000000000; ...
          0.572780927080447588; ...
          0.644010658401200531; ...
          0.712171060103719444; ...
          0.775809417943609914; ...
          0.833569402098706114; ...
          0.884219981737838889; ...
          0.926681682291658593; ...
          0.960049667075200341; ...
          0.983613419283153156; ...
          0.996876085310194782 ];
    w = [ 0.00800861412888644909; ...
          0.018476894885426285; ...
          0.0285672127134286406; ...
          0.0380500568141897075; ...
          0.0467222117280169935; ...
          0.0543986495835743558; ...
          0.06091570802686435; ...
          0.0661344693166688452; ...
          0.0699436973955366581; ...
          0.0722622019949851341; ...
          0.073040566824845346; ...
          0.0722622019949851341; ...
          0.0699436973955366581; ...
          0.0661344693166688452; ...
          0.06091570802686435; ...
          0.0543986495835743558; ...
          0.0467222117280169935; ...
          0.0380500568141897075; ...
          0.0285672127134286406; ...
          0.018476894885426285; ...
          0.00800861412888644909 ];
  elseif ( n == 22 )
    x = [ 0.0028527072588003799; ...
          0.0149697510822857094; ...
          0.036521613906413064; ...
          0.0670937111398499653; ...
          0.106091597010395944; ...
          0.152756368406658627; ...
          0.206179798246544199; ...
          0.265322081006621469; ...
          0.329032089553957907; ...
          0.396069786655889322; ...
          0.465130363340138908; ...
          0.534869636659861092; ...
          0.603930213344110678; ...
          0.670967910446042093; ...
          0.734677918993378531; ...
          0.793820201753455801; ...
          0.847243631593341373; ...
          0.893908402989604056; ...
          0.932906288860150035; ...
          0.963478386093586936; ...
          0.985030248917714291; ...
          0.99714729274119962 ];
    w = [ 0.00731399764913532799; ...
          0.0168874507924071104; ...
          0.0261466675763416916; ...
          0.0348982342122602998; ...
          0.0429708031085339753; ...
          0.0502070722214406004; ...
          0.0564661480402697119; ...
          0.0616261884052562506; ...
          0.0655867523935313168; ...
          0.0682707491730076971; ...
          0.0696259364278161291; ...
          0.0696259364278161291; ...
          0.0682707491730076971; ...
          0.0655867523935313168; ...
          0.0616261884052562506; ...
          0.0564661480402697119; ...
          0.0502070722214406004; ...
          0.0429708031085339753; ...
          0.0348982342122602998; ...
          0.0261466675763416916; ...
          0.0168874507924071104; ...
          0.00731399764913532799 ];
  elseif ( n == 23 )
    x = [ 0.00261533250122392147; ...
          0.013728764390942394; ...
          0.0335144565869919253; ...
          0.061623820864779244; ...
          0.0975557991905799948; ...
          0.140669318434024859; ...
          0.190195062118176939; ...
          0.245249261076996294; ...
          0.304849480984854537; ...
          0.367932159514827495; ...
          0.433371587850766904; ...
          0.500000000000000000; ...
          0.566628412149233096; ...
          0.632067840485172505; ...
          0.695150519015145463; ...
          0.754750738923003706; ...
          0.809804937881823061; ...
          0.859330681565975141; ...
          0.902444200809420005; ...
          0.938376179135220756; ...
          0.966485543413008075; ...
          0.986271235609057606; ...
          0.997384667498776079 ];
    w = [ 0.0067059297435702412; ...
          0.015494002928489686; ...
          0.0240188358655423692; ...
          0.0321162107042629943; ...
          0.0396407058883595509; ...
          0.0464578830300175633; ...
          0.052446045732270824; ...
          0.057498320111205814; ...
          0.0615245421533648154; ...
          0.06445286109404115; ...
          0.0662310197023484037; ...
          0.0668272860930531759; ...
          0.0662310197023484037; ...
          0.06445286109404115; ...
          0.0615245421533648154; ...
          0.057498320111205814; ...
          0.052446045732270824; ...
          0.0464578830300175633; ...
          0.0396407058883595509; ...
          0.0321162107042629943; ...
          0.0240188358655423692; ...
          0.015494002928489686; ...
          0.0067059297435702412 ];
  elseif ( n == 24 )
    x = [ 0.00240639000148934468; ...
          0.0126357220143452631; ...
          0.0308627239986336566; ...
          0.0567922364977995198; ...
          0.0899990070130485265; ...
          0.129937904210722821; ...
          0.175953174031512227; ...
          0.227289264305580163; ...
          0.283103246186977464; ...
          0.342478660151918302; ...
          0.404440566263191803; ...
          0.467971553568697241; ...
          0.532028446431302759; ...
          0.595559433736808197; ...
          0.657521339848081698; ...
          0.716896753813022536; ...
          0.772710735694419837; ...
          0.824046825968487773; ...
          0.870062095789277179; ...
          0.910000992986951474; ...
          0.94320776350220048; ...
          0.969137276001366343; ...
          0.987364277985654737; ...
          0.997593609998510655 ];
    w = [ 0.00617061489999283508; ...
          0.014265694314466934; ...
          0.0221387194087098796; ...
          0.0296492924577183847; ...
          0.0366732407055402054; ...
          0.0430950807659766927; ...
          0.0488093260520570393; ...
          0.0537221350579829143; ...
          0.0577528340268628829; ...
          0.0608352364639017928; ...
          0.0629187281734143178; ...
          0.0639690976733762462; ...
          0.0639690976733762462; ...
          0.0629187281734143178; ...
          0.0608352364639017928; ...
          0.0577528340268628829; ...
          0.0537221350579829143; ...
          0.0488093260520570393; ...
          0.0430950807659766927; ...
          0.0366732407055402054; ...
          0.0296492924577183847; ...
          0.0221387194087098796; ...
          0.014265694314466934; ...
          0.00617061489999283508 ];
  elseif ( n == 25 )
    x = [ 0.00222151510475088187; ...
          0.0116680392702412927; ...
          0.0285127143855128384; ...
          0.052504001060862393; ...
          0.0832786856195830705; ...
          0.120370368481321099; ...
          0.163216815763265854; ...
          0.211168534879388581; ...
          0.263498634277142485; ...
          0.319413847095306069; ...
          0.378066558139505737; ...
          0.438567653694644788; ...
          0.500000000000000000; ...
          0.561432346305355212; ...
          0.621933441860494263; ...
          0.680586152904693931; ...
          0.736501365722857515; ...
          0.788831465120611419; ...
          0.836783184236734146; ...
          0.879629631518678901; ...
          0.91672131438041693; ...
          0.947495998939137607; ...
          0.971487285614487162; ...
          0.988331960729758707; ...
          0.997778484895249118 ];
    w = [ 0.00569689925051255347; ...
          0.0131774933075161083; ...
          0.0204695783506531476; ...
          0.0274523479879176906; ...
          0.0340191669061785454; ...
          0.0400703501675005319; ...
          0.0455141309914819034; ...
          0.0502679745335253628; ...
          0.0542598122371318672; ...
          0.0574291295728558623; ...
          0.0597278817678924615; ...
          0.0611212214951551217; ...
          0.061588026863357799;  ...
          0.0611212214951551217; ...
          0.0597278817678924615; ...
          0.0574291295728558623; ...
          0.0542598122371318672; ...
          0.0502679745335253628; ...
          0.0455141309914819034; ...
          0.0400703501675005319; ...
          0.0340191669061785454; ...
          0.0274523479879176906; ...
          0.0204695783506531476; ...
          0.0131774933075161083; ...
          0.00569689925051255347 ];
  else
    fprintf ( 1, '\n' );
    fprintf ( 1, 'GQU2 - Fatal error!\n' );
    fprintf ( 1, '  Value of N must be between 1 and 25.\n' );
    error ( 'GQU2 - Fatal error!' );
  end

  return
end
