Top Banner

of 12

High-Precision Abscissae and Weights of Gaussian Quadrature

Mar 01, 2016

Download

Documents

RMolina65

High-Precision Abscissae and Weights of Gaussian Quadrature
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

Pavel HoloborodkoApplied mathematics and beyondSkip to content Home MPFR C++ Numerical Methods Numerical Differentiation Central Differences Low-noise Lanczos differentiators Smooth noise-robust differentiators Numerical Integration Cubature formulas for the unit disk Stable Newton-Cotes Formulas Overlapped Newton-Cotes Quadratures QuickLaTeX Image Processing Noise Robust Gradient Operators AboutNumerical IntegrationOne of the most widely used methods of numerical integration is Gauss-Legendre quadrature. It posses very attractive property of to be exact on polynomials of degree up to , while using only integrand evaluations (-point quadrature).The algorithm consists in approximation of initial definite integral by the sum of weighted integrand values sampled at special points called abscissas:

where values are zeroes of the -degree Legendre polynomial . Accuracy of the numerical integration depends significantly on precision of zeroes . There is no easy-to-use analytical expression for and usually they are computed numerically by root-finding algorithms.Surprisingly popular mathematical references/software provide low-precision (only 4-6 correct digits) for limited . Obviously such situation doesnt reflect contemporary computational capabilities and accuracy demands of many applications. For instance, commonly used floating-point type double of IEEE 754 standard is capable to store values with 16 digits precision (machine epsilon is about 1e-16 for 64 bits double).This page aims to provide software libraries for calculation of high-precision abscissas and weights for any desired .Gauss-Legendre Quadrature for C/C++This open-source library implements numerical integration based on Gauss-Legendre quadrature of any order. Gauss-Legendre Quadrature.zipPre-calculated high-precision abscissas and weights with 25 correct decimal places are used for specific orders n=2,, 20, 32, 64, 96, 100, 128, 256, 512, 1024. Although all values can be found in the source code human-friendly tables with abscissas and weights are available too. Nodes for all other n are generated on the fly with 1e-10 precision by fast root-finding algorithm. Library also includes routine for numerical integration over 2D rectangle using product of two 1D Gaussian quadratures.If you are looking for numerical integration over the unit disk (2D sphere) you might be interested in this page Cubature formulas for the unit disk. It contains derivation details and source code in C/C++.Gauss-Legendre Quadrature for MATLABThere are several routines for Gaussian quadrature implemented using Matlab programming language. All of them suffer from low performance and even some of them provide low accuracy results. To alleviate the situation I am developing quadrature toolbox which has Matlab interface (m-files) and delegates all the heavy lifting to high-performance MEX library written in C/C++ (see previous section). So far it includes only Gauss-Legendre rule with many others to come: Gauss-Legendre Quadrature for Matlab.zipQuadrature toolbox consists of three files:GaussLegendre.mquadlab.mexw32quadlab.mexw64Toolbox was created and tested using Matlab R2010b, both on 32 and 64 bits versions. Usage example:>>GaussLegendre(@cos,-pi/2,pi/2,1024) ans = 2.000000000000000GaussLegendre() accepts Matlab function (inline or from m-file), integration boundaries , order of quadrature (1024 in example) and desired precision for nodes as optional parameter. Also it returns vectors of abscissas and weights if such outputs are specified.Performance comparison with the fastest Matlab-language routine (x-quadrature order, y-execution time, green-quadrature toolbox, red-competitor, lower is better):

Besides being fast library usually provides results with better accuracy thanks to pre-calculated high-precision abscissas and weights.I am extending quadrature toolbox for Matlab with other rules and adaptive methods. I would really appreciate any feature suggestions and advices on what methods to include first. Abscissae and Weights of Gauss-Legendre QuadratureTable below lists Gauss-Legendre quadrature nodes for n=2,, 20, 32, 64, 100 with the accuracy of 25 decimal digits. Data for higher order formulae n = 128, 256, 512, 1024 can be found in C/C++ library source code. High-precision Abscissae and Weights of Gaussian Quadrature.Correctly rounded to 25 decimal digits to the nearest.

Abscisae Weights

20.57735026918962576450914881.0000000000000000000000000

300.8888888888888888888888889

0.77459666924148337703585310.5555555555555555555555556

40.33998104358485626480266580.6521451548625461426269361

0.86113631159405257522394650.3478548451374538573730639

500.5688888888888888888888889

0.53846931010568309103631440.4786286704993664680412915

0.90617984593866399279762690.2369268850561890875142640

60.23861918608319690863050170.4679139345726910473898703

0.66120938646626451366139960.3607615730481386075698335

0.93246951420315202781230160.1713244923791703450402961

700.4179591836734693877551020

0.40584515137739716690660640.3818300505051189449503698

0.74153118559939443986386480.2797053914892766679014678

0.94910791234275852452618970.1294849661688696932706114

80.18343464249564980493947610.3626837833783619829651504

0.52553240991632898581773900.3137066458778872873379622

0.79666647741362673959155390.2223810344533744705443560

0.96028985649753623168356090.1012285362903762591525314

900.3302393550012597631645251

0.32425342340380892903853800.3123470770400028400686304

0.61337143270059039730870200.2606106964029354623187429

0.83603110732663579429942980.1806481606948574040584720

0.96816023950762608983557620.0812743883615744119718922

100.14887433898163121088482600.2955242247147528701738930

0.43339539412924719079926590.2692667193099963550912269

0.67940956829902440623432740.2190863625159820439955349

0.86506336668898451073209670.1494513491505805931457763

0.97390652851717172007796400.0666713443086881375935688

1100.2729250867779006307144835

0.26954315595234497233153200.2628045445102466621806889

0.51909612920681181592572570.2331937645919904799185237

0.73015200557404932409341630.1862902109277342514260976

0.88706259976809529907515780.1255803694649046246346943

0.97822865814605699280393800.0556685671161736664827537

120.12523340851146891547244140.2491470458134027850005624

0.36783149899818019375269150.2334925365383548087608499

0.58731795428661744729670240.2031674267230659217490645

0.76990267419430468703689380.1600783285433462263346525

0.90411725637047485667846590.1069393259953184309602547

0.98156063424671925069054910.0471753363865118271946160

1300.2325515532308739101945895

0.23045831595513479406552810.2262831802628972384120902

0.44849275103644685287791290.2078160475368885023125232

0.64234933944034022064398460.1781459807619457382800467

0.80157809073330991279420650.1388735102197872384636018

0.91759839922297796520654780.0921214998377284479144218

0.98418305471858814947282940.0404840047653158795200216

140.10805494870734366206624470.2152638534631577901958764

0.31911236892788976043567180.2051984637212956039659241

0.51524863635815409196529070.1855383974779378137417166

0.68729290481168547014801980.1572031671581935345696019

0.82720131506976499318979470.1215185706879031846894148

0.92843488366357351733639110.0801580871597602098056333

0.98628380869681233884159730.0351194603317518630318329

1500.2025782419255612728806202

0.20119409399743452230062830.1984314853271115764561183

0.39415134707756336989720740.1861610000155622110268006

0.57097217260853884753722670.1662692058169939335532009

0.72441773136017004741618610.1395706779261543144478048

0.84820658341042721620064830.1071592204671719350118695

0.93727339240070590430775890.0703660474881081247092674

0.98799251802048542848956570.0307532419961172683546284

160.09501250983763744018531930.1894506104550684962853967

0.28160355077925891323046050.1826034150449235888667637

0.45801677765722738634241940.1691565193950025381893121

0.61787624440264374844667180.1495959888165767320815017

0.75540440835500303389510120.1246289712555338720524763

0.86563120238783174388046790.0951585116824927848099251

0.94457502307323257607798840.0622535239386478928628438

0.98940093499164993259615420.0271524594117540948517806

1700.1794464703562065254582656

0.17848418149584785585067750.1765627053669926463252710

0.35123176345387631529718550.1680041021564500445099707

0.51269053708647696788624660.1540457610768102880814316

0.65767115921669076585030220.1351363684685254732863200

0.78151400389680140692523010.1118838471934039710947884

0.88023915372698590212295570.0850361483171791808835354

0.95067552176876776122271700.0554595293739872011294402

0.99057547531441733567543400.0241483028685479319601100

180.08477501304173530124226190.1691423829631435918406565

0.25188622569150550958897290.1642764837458327229860538

0.41175116146284264603593180.1546846751262652449254180

0.55977083107394753460787150.1406429146706506512047313

0.69168704306035320787489110.1225552067114784601845191

0.80370495897252311568241750.1009420441062871655628140

0.89260246649755573920606060.0764257302548890565291297

0.95582394957139775518119590.0497145488949697964533349

0.99156516842093094673001600.0216160135264833103133427

1900.1610544498487836959791636

0.16035864564022537586809610.1589688433939543476499564

0.31656409996362983199011730.1527660420658596667788554

0.46457074137596094571726710.1426067021736066117757461

0.60054530466168102346963820.1287539625393362276755158

0.72096617733522937861709590.1115666455473339947160239

0.82271465653714282497892250.0914900216224499994644621

0.90315590361481790164266090.0690445427376412265807083

0.96020815213483003085277880.0448142267656996003328382

0.99240684384358440318901770.0194617882297264770363120

200.07652652113349733375464040.1527533871307258506980843

0.22778585114164507808049620.1491729864726037467878287

0.37370608871541956067254820.1420961093183820513292983

0.51086700195082709800436410.1316886384491766268984945

0.63605368072651502545283670.1181945319615184173123774

0.74633190646015079261430510.1019301198172404350367501

0.83911697182221882339452910.0832767415767047487247581

0.91223442825132590586775240.0626720483341090635695065

0.96397192727791379126766610.0406014298003869413310400

0.99312859918509492478612240.0176140071391521183118620

320.04830766568773831623481260.0965400885147278005667648

0.14447196158279649348518640.0956387200792748594190820

0.23928736225213707454460320.0938443990808045656391802

0.33186860228212764977991680.0911738786957638847128686

0.42135127613063534536411940.0876520930044038111427715

0.50689990893222939002374750.0833119242269467552221991

0.58771575724076232904074550.0781938957870703064717409

0.66304426693021520097511520.0723457941088485062253994

0.73218211874028968038742670.0658222227763618468376501

0.79448379596794240696309730.0586840934785355471452836

0.84936761373256997013369300.0509980592623761761961632

0.89632115576605212396530720.0428358980222266806568786

0.93490607593773968917091910.0342738629130214331026877

0.96476225558750643077381190.0253920653092620594557526

0.98561151154526833540017500.0162743947309056706051706

0.99726386184948156354498110.0070186100094700966004071

640.02435029266342443250895580.0486909570091397203833654

0.07299312178779903944954290.0485754674415034269347991

0.12146281929612055447037650.0483447622348029571697695

0.16964442042399281803731360.0479993885964583077281262

0.21742364374000708414964870.0475401657148303086622822

0.26468716220876741637396420.0469681828162100173253263

0.31132287199021095615751270.0462847965813144172959532

0.35722015833766811595044260.0454916279274181444797710

0.40227015796399160369576680.0445905581637565630601347

0.44636601725346408798494770.0435837245293234533768279

0.48940314570705295747852630.0424735151236535890073398

0.53127946401989454565801390.0412625632426235286101563

0.57189564620263403428387810.0399537411327203413866569

0.61115535517239325024885300.0385501531786156291289625

0.64896547125465733985776120.0370551285402400460404151

0.68523631305423324256355840.0354722132568823838106931

0.71988185017161082684894020.0338051618371416093915655

0.75281990726053189661186380.0320579283548515535854675

0.78397235894334140761022050.0302346570724024788679741

0.81326531512279755974192330.0283396726142594832275113

0.84062929625258036275169150.0263774697150546586716918

0.86599939815409281976078340.0243527025687108733381776

0.88931544599511410585340400.0222701738083832541592983

0.91052213707850280575638070.0201348231535302093723403

0.92956917213193957582149020.0179517157756973430850453

0.94641137485840281606248150.0157260304760247193219660

0.96100879965205371891861410.0134630478967186425980608

0.97332682778991096374185350.0111681394601311288185905

0.98333625388462595693129930.0088467598263639477230309

0.99101337147674432073938240.0065044579689783628561174

0.99634011677195527934692450.0041470332605624676352875

0.99930504173577213945690560.0017832807216964329472961

1000.01562898442154308287221670.0312554234538633569476425

0.04687168242159163161492390.0312248842548493577323765

0.07806858281343663669481740.0311638356962099067838183

0.10918920358006111500342600.0310723374275665165878102

0.14020313723611397320751460.0309504788504909882340635

0.17108008053860327488753240.0307983790311525904277139

0.20178986409573599723604890.0306161865839804484964594

0.23230248184497396964951000.0304040795264548200165079

0.26258812037150347916892930.0301622651051691449190687

0.29261718803847196473755590.0298909795933328309168368

0.32236034390052915172247660.0295904880599126425117545

0.35178852637242172097234380.0292610841106382766201190

0.38087298162462995676336250.0289030896011252031348762

0.40958529167830154252886840.0285168543223950979909368

0.43789740217203151310897800.0281027556591011733176483

0.46578164977335804224921660.0276611982207923882942042

0.49321078920819093356930880.0271926134465768801364916

0.52015801988176305664681570.0266974591835709626603847

0.54659701206509416746799430.0261762192395456763423087

0.57250193262138119131687040.0256294029102081160756420

0.59784747024717872126480650.0250575444815795897037642

0.62260886020370777160419080.0244612027079570527199750

0.64676190851412927983263030.0238409602659682059625604

0.67028301560314101580258700.0231974231852541216224889

0.69314919935580196594864790.0225312202563362727017970

0.71533811757305644645996710.0218430024162473863139537

0.73682808980202070551242770.0211334421125276415426723

0.75759811851970717603566800.0204032326462094327668389

0.77762790964949547562755140.0196530874944353058653815

0.79689789239031447638957290.0188837396133749045529412

0.81538923833917625439398880.0180959407221281166643908

0.83308387988840082354291580.0172904605683235824393442

0.84996452787959128429336260.0164680861761452126431050

0.86601468849716462341074000.0156296210775460027239369

0.88121867938501841557331680.0147758845274413017688800

0.89556164497072698669852100.0139077107037187726879541

0.90902957098252969046712630.0130259478929715422855586

0.92160929814533395266695130.0121314576629794974077448

0.93328853504307954592433370.0112251140231859771172216

0.94405587013625597796277470.0103078025748689695857821

0.95390078292549174284933690.0093804196536944579514182

0.96281365425581552729365930.0084438714696689714026208

0.97078577576370633193089790.0074990732554647115788287

0.97780935848691828855378110.0065469484508453227641521

0.98387754070605701549610020.0055884280038655151572119

0.98898439524299174800441870.0046244500634221193510958

0.99312493703744345965200990.0036559612013263751823425

0.99629513473312514918613170.0026839253715534824194396

0.99849195063959581840016340.0017093926535181052395294

0.99971372677344123367822850.0007346344905056717304063

(8 votes, average: 5.00)

Loading ...Print This Page5 Comments1. BenPosted June 17, 2011 at 6:47 pm | #Its worth looking at eigenvalue methods to calculate the nodes and weights. Basically the 3 term polynomial recurrence relation allows the roots to be expressed as eigenvalues of a tridiagonal matrix; with appropriate rescaling the matrix is transformed to symmetric tridiagonal and hence the roots can be determined to arbitrary precision e.g. with your MPFR library. Similarly the weights can be expressed in terms of the eigenvectors.Reply Pavel HoloborodkoPosted June 18, 2011 at 12:59 pm | #Derivation of quadrature nodes using eigenvalues/vectors of Jacobi matrix is universal approach. Although it is very powerful I find it inefficient for particular well studied case Gauss-Legendre quadrature.We have nice analytic formula for close approximation of Legendre polynomial roots. Starting from there Newton iterations converge to real root very quickly with any desired precision. I think even Golub-Welsch eigen solver optimized for symmetric 3-diagonal matrices cannot beat that. P.S.BTW Ive used eigen method to derive quadrature for less-known weight function here: Cubature formulas for the unit disk.P.P.S.Thanks for reading pages on my site .Reply2. Gowri PriyaPosted July 14, 2011 at 4:36 pm | #Thank u very much for giving useful informationReply3. vladanPosted August 4, 2011 at 10:12 pm | #Do you know where I can find Abscissae and Weights of Gauss-Legendre Quadrature for Associated Legendre?Reply Pavel HoloborodkoPosted August 5, 2011 at 9:27 am | #Do you mean quadrature based on Associated Legendre polynomials? I dont know this kind of quadrature.Could you be more specific what task do you solve ?ReplyPost a CommentClick here to cancel reply.Principio del formularioYour email is never published nor shared. Name

Email

Website

Comment

Use native LaTeX syntax to include formulas: $ ... $, \[ ... \], etc. Do not forget to preview comment before posting.Also you may use these HTML tags and attributes: Notify me of followup comments via e-mailFinal del formularioPrincipio del formularioSubscribe without commenting E-Mail: Final del formularioPowered by WordPress with QuickLaTeX. Built on the Thematic Theme Framework.