QUADPACK

{{Short description|Software library for numerical integration}}

{{Infobox software

| name = QUADPACK

| title = QUADPACK

| collapsible =

| author = Robert Piessens
Elise deDoncker-Kapenga
Christoph W. Überhuber
David Kahaner

| developer =

| released = {{Start date|1981|05}}

| discontinued = yes

| latest release version = May 1987{{cite web|url=http://www.netlib.org/quadpack/changes|title=quadpack/changes|publisher=Netlib|access-date= November 16, 2010}}

| latest release date =

| latest preview version =

| latest preview date =

| programming language = FORTRAN 77

| operating system =

| platform =

| size =

| language =

| genre = Library

| license = Public domain

| website = {{url|https://nines.cs.kuleuven.be/software/QUADPACK/}}

}}

QUADPACK is a FORTRAN 77 library for numerical integration of one-dimensional functions. It was included in the SLATEC Common Mathematical Library and is therefore in the public domain.{{cite web|last=Fong|first= Kirby W.|title=Guide to the SLATEC Common Mathematical Library|url=http://www.netlib.org/slatec/guide|publisher=netlib.org|access-date=November 13, 2010|author2=Jefferson, Thomas H. |author3=Suyehiro, Tokihiko |author4= Walton, Lee |date=July 1993}} The individual subprograms are also available on netlib.{{cite web|url=http://www.netlib.org/quadpack|title=quadpack|publisher=Netlib|access-date=November 13, 2010}}

The GNU Scientific Library reimplemented the QUADPACK routines in C. SciPy provides a Python interface to part of QUADPACK.{{cite web|title=scipy.integrate.quad -- SciPy v0.14.0 Reference Guide|url=http://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.quad.html|access-date=1 July 2014}}

The [https://www.cdslab.org/paramonte/fortran/latest/namespacepm__quadPack.html pm_quadpack] module of the ParaMonte library offers a 100% type-kind-generic multi-precision implementation of QUADPACK library in modern Fortran.

Routines

The main focus of QUADPACK is on automatic integration routines in which the user inputs the problem and an absolute or relative error tolerance and the routine attempts to perform the integration with an error no larger than that requested. There are nine such automatic routines in QUADPACK, in addition to a number of non-automatic routines. All but one of the automatic routines use adaptive quadrature.

style="border: 1px solid darkgray"

|+ Summary of naming scheme for automatic routines{{cite book|last=Zwillinger|first=Daniel|title=Handbook of integration|year=1992|publisher=A K Peters|isbn=978-0-86720-293-9|url=https://books.google.com/books?id=DQd4wfV7fo0C&pg=PA255|page=255}}

! 1st letter !! 2nd letter !! 3rd letter !! 4th letter

{| class="wikitable" border="0"

| Q

Quadrature

|

class="wikitable" border="0"

| N

Non-adaptive
AAdaptive

|

class="wikitable" border="0"

|G

General integrand
WWeight function of specified form

|

class="wikitable" border="0"

|

Simple integrator
SSingularities handled
PSpecified points of local difficulty (singularities, discontinuities …)
IInfinite interval
OOscillatory weight function (cos or sin) over a finite interval
FFourier transform (cos or sin)
CCauchy principal value

|}

Each of the adaptive routines also have versions suffixed by E that have an extended parameter list that provides more information and allows more control. Double precision versions of all routines were released with prefix D.

=General-purpose routines=

The two general-purpose routines most suitable for use without further analysis of the integrand are QAGS for integration over a finite interval and QAGI for integration over an infinite interval. These two routines are used in GNU Octave (the quad command){{cite web|url=http://nines.cs.kuleuven.be/software/QUADPACK|title=QUADPACK|publisher=Numerical Integration, Nonlinear Equations & Software (NINES) Group, Katholieke Universiteit Leuven|access-date=November 13, 2010}} and R (the integrate function).{{cite web |title=integrate {stats}: Integration of One-Dimensional Functions |url=http://stat.ethz.ch/R-manual/R-devel/library/stats/html/integrate.html |work=Documentation for package ‘stats’ version 2.13.0 |access-date=16 November 2010 |date=October 2010}}

;QAGS : uses global adaptive quadrature based on 21-point Gauss–Kronrod quadrature within each subinterval, with acceleration by Peter Wynn's epsilon algorithm.{{cite web|title=17.4 QAGS adaptive integration with singularities|url=https://www.gnu.org/software/gsl/manual/html_node/QAGS-adaptive-integration-with-singularities.html|work=GNU Scientific Library -- Reference| publisher=Free Software Foundation|access-date=16 November 2010}}

;QAGI : is the only general-purpose routine for infinite intervals, and maps the infinite interval onto the semi-open interval (0,1] using a transformation then uses the same approach as QAGS, except with 15-point rather than 21-point Gauss–Kronrod quadrature. For an integral over the whole real line, the transformation used is x = (1-t)/t:{{cite book| last1=Piessens | first1=Robert |last2=de Doncker-Kapenga | first2=Elise | last3=Überhuber | first3=Christoph W. | last4=Kahaner | first4=David | title=QUADPACK: A subroutine package for automatic integration | year=1983 | publisher=Springer-Verlag | isbn=978-3-540-12553-2 }}

\int_{-\infty}^{+\infty} f(x) dx = \int_0^1 {dt\over t^2} \left(f\left(\frac{1-t}{t}\right)

+ f\left(-\frac{1-t}{t}\right)\right) \;.

This is not the best approach for all integrands: another transformation may be appropriate, or one might prefer to break up the original interval and use QAGI only on the infinite part.{{cite web |last=Piessens |first=Robert |title=Subroutine QPDOC |url=http://www.netlib.org/quadpack/doc |work=QUADPACK |publisher=netlib |access-date=16 November 2010 |display-authors=et al |date=1984-04-17}}

=Brief overview of the other automatic routines=

;QNG : simple non-adaptive integrator

;QAG : simple adaptive integrator

;QAGP : similar to QAGS but allows user to specify locations of internal singularities, discontinuities etc.

;QAWO : integral of {{math|cos(ωx) f(x)}} or {{math|sin(ωx) f(x)}} over a finite interval

;QAWF : Fourier transform

;QAWS : integral of {{math|w(x) f(x)}} from {{math|a}} to {{math|b}}, where {{math|f}} is smooth and {{math|w(x) {{=}} (xa)α (bx)β logk(xa) logl(bx)}}, with {{math|k, l {{=}} 0 or 1}} and {{math|α, β > –1}}

;QAWC : Cauchy principal value of the integral of {{math|f(x)/(xc)}} for user-specified {{math|c}} and {{math|f}}

See also

References

{{reflist|30em}}

Further reading

  • {{Cite journal | last1 = Favati | first1 = P. | last2 = Lotti | first2 = G. | last3 = Romani | first3 = F. | title = Algorithm 691; Improving QUADPACK automatic integration routines | journal = ACM Transactions on Mathematical Software | volume = 17 | issue = 2 | pages = 218–232 | year = 1991 | doi = 10.1145/108556.108580| s2cid = 19675880 | doi-access = free }}
  • {{Cite journal | last1 = Cools | first1 = R. | last2 = Haegemans | first2 = A. | doi = 10.1145/838250.838253 | title = Algorithm 824: CUBPACK: a package for automatic cubature; framework description| journal = ACM Transactions on Mathematical Software | volume = 29 | issue = 3 | pages = 287–296| year = 2003 | s2cid = 6855610 }}

Category:Fortran libraries

Category:Numerical integration

Category:Numerical software

Category:Public-domain software with source code