Tanh-sinh quadrature

Last updated

Tanh-sinh quadrature is a method for numerical integration introduced by Hidetoshi Takahashi and Masatake Mori in 1974. [1] It is especially applied where singularities or infinite derivatives exist at one or both endpoints.

Contents

The method uses hyperbolic functions in the change of variables

to transform an integral on the interval x  (−1, 1) to an integral on the entire real line t  (−∞, ∞), the two integrals having the same value. After this transformation, the integrand decays with a double exponential rate, and thus, this method is also known as the double exponential (DE) formula. [2]

For a given step size , the integral is approximated by the sum

with the abscissas

and the weights

Use

The Tanh-Sinh method is quite insensitive to endpoint behavior. Should singularities or infinite derivatives exist at one or both endpoints of the (−1, 1) interval, these are mapped to the (−∞,∞) endpoints of the transformed interval, forcing the endpoint singularities and infinite derivatives to vanish. This results in a great enhancement of the accuracy of the numerical integration procedure, which is typically performed by the Trapezoidal rule. In most cases, the transformed integrand displays a rapid roll-off (decay), enabling the numerical integrator to quickly achieve convergence.

Like Gaussian quadrature, Tanh-Sinh quadrature is well suited for arbitrary-precision integration, where an accuracy of hundreds or even thousands of digits is desired. The convergence is exponential (in the discretization sense) for sufficiently well-behaved integrands: doubling the number of evaluation points roughly doubles the number of correct digits. However, Tanh-Sinh quadrature is not as efficient as Gaussian quadrature for smooth integrands; but unlike Gaussian quadrature, tends to work equally well with integrands having singularities or infinite derivatives at one or both endpoints of the integration interval as already noted. Furthermore, Tanh-Sinh quadrature can be implemented in a progressive manner, with the step size halved each time the rule level is raised, and reusing the function values calculated on previous levels. A further advantage is that the abscissas and weights are relatively simple to compute. The cost of calculating abscissa–weight pairs for n-digit accuracy is roughly n2 log2n compared to n3 log n for Gaussian quadrature.

Bailey and others have done extensive research on Tanh-Sinh quadrature, Gaussian quadrature and Error Function quadrature, as well as several of the classical quadrature methods, and found that the classical methods are not competitive with the first three methods, particularly when high-precision results are required. In a conference paper presented at RNC5 on Real Numbers and Computers (Sept 2003), when comparing Tanh-Sinh quadrature with Gaussian quadrature and Error Function quadrature, Bailey and Li found: "Overall, the Tanh-Sinh scheme appears to be the best. It combines uniformly excellent accuracy with fast run times. It is the nearest we have to a truly all-purpose quadrature scheme at the present time."

Upon comparing the scheme to Gaussian quadrature and Error Function quadrature, Bailey et al. (2005) found that the Tanh-Sinh scheme "appears to be the best for integrands of the type most often encountered in experimental math research".

Bailey (2006) found that: "The Tanh-Sinh quadrature scheme is the fastest currently known high-precision quadrature scheme, particularly when one counts the time for computing abscissas and weights. It has been successfully employed for quadrature calculations of up to 20,000-digit precision."

In summary, the Tanh-Sinh quadrature scheme is designed so that it gives the most accurate result for the minimum number of function evaluations. In practice, the Tanh-Sinh quadrature rule is almost invariably the best rule and is often the only effective rule when extended precision results are sought[ citation needed ].

Implementations

Notes

  1. Takahashi & Mori (1974)
  2. Mori (2005)
  3. Thompson, Nick; Maddock, John. "Double-exponential quadrature". boost.org.
  4. Dennes, Graeme. "Numerical Integration With Tanh-Sinh Quadrature". Newton Excel Bach, not (just) an Excel Blog.
  5. Kmett, Edward. "integration: Fast robust numeric integration via tanh-sinh quadrature". Hackage.
  6. "mpmath library for real and complex floating-point arithmetic with arbitrary precision". mpmath.
  7. Ganchovski, Ned. "Tanh-Sinh Integration with C#". GitHub repository.

Related Research Articles

<span class="mw-page-title-main">Gaussian quadrature</span> Approximation of the definite integral of a function

In numerical analysis, an n-point Gaussian quadrature rule, named after Carl Friedrich Gauss, is a quadrature rule constructed to yield an exact result for polynomials of degree 2n − 1 or less by a suitable choice of the nodes xi and weights wi for i = 1, ..., n.

<span class="mw-page-title-main">Hyperbolic functions</span> Collective name of 6 mathematical functions

In mathematics, hyperbolic functions are analogues of the ordinary trigonometric functions, but defined using the hyperbola rather than the circle. Just as the points (cos t, sin t) form a circle with a unit radius, the points (cosh t, sinh t) form the right half of the unit hyperbola. Also, similarly to how the derivatives of sin(t) and cos(t) are cos(t) and –sin(t) respectively, the derivatives of sinh(t) and cosh(t) are cosh(t) and +sinh(t) respectively.

<span class="mw-page-title-main">Numerical integration</span> Methods of calculating definite integrals

In analysis, numerical integration comprises a broad family of algorithms for calculating the numerical value of a definite integral. The term numerical quadrature is more or less a synonym for "numerical integration", especially as applied to one-dimensional integrals. Some authors refer to numerical integration over more than one dimension as cubature; others take "quadrature" to include higher-dimensional integration.

Integration is the basic operation in integral calculus. While differentiation has straightforward rules by which the derivative of a complicated function can be found by differentiating its simpler component functions, integration does not, so tables of known integrals are often useful. This page lists some of the most common antiderivatives.

<span class="mw-page-title-main">Newton–Cotes formulas</span> Formulas for numerical integration

In numerical analysis, the Newton–Cotes formulas, also called the Newton–Cotes quadrature rules or simply Newton–Cotes rules, are a group of formulas for numerical integration based on evaluating the integrand at equally spaced points. They are named after Isaac Newton and Roger Cotes.

<span class="mw-page-title-main">Trapezoidal rule</span> Numerical integration method

In calculus, the trapezoidal rule is a technique for numerical integration, i.e., approximating the definite integral:

In numerical analysis, Romberg's method is used to estimate the definite integral

<span class="mw-page-title-main">Monte Carlo integration</span> Numerical technique

In mathematics, Monte Carlo integration is a technique for numerical integration using random numbers. It is a particular Monte Carlo method that numerically computes a definite integral. While other algorithms usually evaluate the integrand at a regular grid, Monte Carlo randomly chooses points at which the integrand is evaluated. This method is particularly useful for higher-dimensional integrals.

<span class="mw-page-title-main">Hyperbolic angle</span> Argument of the hyperbolic functions

In geometry, hyperbolic angle is a real number determined by the area of the corresponding hyperbolic sector of xy = 1 in Quadrant I of the Cartesian plane. The hyperbolic angle parametrises the unit hyperbola, which has hyperbolic functions as coordinates. In mathematics, hyperbolic angle is an invariant measure as it is preserved under hyperbolic rotation.

<span class="mw-page-title-main">Hyperbolic triangle</span> Triangle in hyperbolic geometry

In hyperbolic geometry, a hyperbolic triangle is a triangle in the hyperbolic plane. It consists of three line segments called sides or edges and three points called angles or vertices.

In mathematics, the Fourier sine and cosine transforms are forms of the Fourier transform that do not use complex numbers or require negative frequency. They are the forms originally used by Joseph Fourier and are still preferred in some applications, such as signal processing or statistics.

Clenshaw–Curtis quadrature and Fejér quadrature are methods for numerical integration, or "quadrature", that are based on an expansion of the integrand in terms of Chebyshev polynomials. Equivalently, they employ a change of variables and use a discrete cosine transform (DCT) approximation for the cosine series. Besides having fast-converging accuracy comparable to Gaussian quadrature rules, Clenshaw–Curtis quadrature naturally leads to nested quadrature rules, which is important for both adaptive quadrature and multidimensional quadrature (cubature).

Adaptive quadrature is a numerical integration method in which the integral of a function is approximated using static quadrature rules on adaptively refined subintervals of the region of integration. Generally, adaptive algorithms are just as efficient and effective as traditional algorithms for "well behaved" integrands, but are also effective for "badly behaved" integrands for which traditional algorithms may fail.

In mathematics numerical analysis, the Nyström method or quadrature method seeks the numerical solution of an integral equation by replacing the integral with a representative weighted sum. The continuous problem is broken into discrete intervals; quadrature or numerical integration determines the weights and locations of representative points for the integral.

The Gauss–Kronrod quadrature formula is an adaptive method for numerical integration. It is a variant of Gaussian quadrature, in which the evaluation points are chosen so that an accurate approximation can be computed by re-using the information produced by the computation of a less accurate approximation. It is an example of what is called a nested quadrature rule: for the same set of function evaluation points, it has two quadrature rules, one higher order and one lower order. The difference between these two approximations is used to estimate the calculational error of the integration.

In numerical analysis Gauss–Laguerre quadrature is an extension of the Gaussian quadrature method for approximating the value of integrals of the following kind:

In numerical analysis, Gauss–Legendre quadrature is a form of Gaussian quadrature for approximating the definite integral of a function. For integrating over the interval [−1, 1], the rule takes the form:

<span class="mw-page-title-main">Gustav von Escherich</span> Austrian mathematician

Gustav Ritter von Escherich was an Austrian mathematician.

Bayesian quadrature is a method for approximating intractable integration problems. It falls within the class of probabilistic numerical methods. Bayesian quadrature views numerical integration as a Bayesian inference task, where function evaluations are used to estimate the integral of that function. For this reason, it is sometimes also referred to as "Bayesian probabilistic numerical integration" or "Bayesian numerical integration". The name "Bayesian cubature" is also sometimes used when the integrand is multi-dimensional. A potential advantage of this approach is that it provides probabilistic uncertainty quantification for the value of the integral.

In numerical analysis, Filon quadrature or Filon's method is a technique for numerical integration of oscillatory integrals. It is named after English mathematician Louis Napoleon George Filon, who first described the method in 1934.

References