 Tanhsinh quadrature

Tanhsinh quadrature is a method for numerical integration introduced by Hidetosi Takahasi and Masatake Mori in 1974.^{[1]} It uses the change of variables
to transform an integral on the interval x ∈ (−1, +1) to an integral on the entire real line t ∈ (−∞,+∞). 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 h, the integral is approximated by the sum
with the abscissas
and the weights
Like Gaussian quadrature, tanhsinh quadrature is well suited for arbitraryprecision integration, where an accuracy of hundreds or even thousands of digits is desired. The convergence is quadratic for sufficiently wellbehaved integrands: doubling the number of evaluation points roughly doubles the number of correct digits.
Tanhsinh quadrature is less efficient than 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. A further advantage is that the abscissas and weights are relatively easy to compute. The cost of calculating abscissaweight pairs for ndigit accuracy is roughly n^{2} log^{2} n compared to n^{3} log n for Gaussian quadrature.
Upon comparing the scheme to Gaussian quadrature and error function quadrature, Bailey et al. (2005) found that the tanhsinh scheme "appears to be the best for integrands of the type most often encountered in experimental math research".
Bailey and others have done extensive research on tanhsinh 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 highprecision results are required. In a conference paper (July 2004) comparing tanhsinh quadrature with Gaussian quadrature and error function quadrature, Bailey and Li found: "Overall, the tanhsinh scheme appears to be the best. It combines uniformly excellent accuracy with fast run times. It is the nearest we have to a truly allpurpose quadrature scheme at the present time."
Bailey (2006) found that: "The tanhsinh quadrature scheme is the fastest known highprecision quadrature scheme, especially when the time for computing abscissas and weights is considered. It has been successfully employed for quadrature calculations of up to 20,000digit precision. It works well for functions with blowup singularities or infinite derivatives at endpoints."
Notes
References
 David H. Bailey, "TanhSinh HighPrecision Quadrature". (2006).
 Pascal Molin, Intégration numérique et calculs de fonctions L (French), doctoral thesis (2010).
 David H. Bailey, Karthik Jeyabalan, and Xiaoye S. Li, "A comparison of three highprecision quadrature schemes". Experimental Mathematics, 14.3 (2005).
 David H. Bailey, Jonathan M. Borwein, David Broadhurst, and Wadim Zudlin, Experimental mathematics and mathematical physics, in Gems in Experimental Mathematics (2010), American Mathematical Society, pp. 41–58.
 David H. Bailey and Xiaoye S. Li, "A Comparison of Three HighPrecision Quadrature Schemes". Conference papers for Proceedings of the RNC5 Conference on Real Numbers and Computers, July 2004, page 83.
 Jonathan Borwein, David H. Bailey, and Roland Girgensohn, Experimentation in Mathematics—Computational Paths to Discovery. A K Peters, 2003. ISBN 1568811365.
 Mori, Masatake (2005), "Discovery of the double exponential transformation and its developments", Publications of the Research Institute for Mathematical Sciences 41 (4): 897–935, doi:10.2977/prims/1145474600, ISSN 00345318. This paper is also available from here.
 Press, WH; Teukolsky, SA; Vetterling, WT; Flannery, BP (2007), "Section 4.5. Quadrature by Variable Transformation", Numerical Recipes: The Art of Scientific Computing (3rd ed.), New York: Cambridge University Press, ISBN 9780521880688, http://apps.nrbook.com/empanel/index.html?pg=172
 Takahasi, Hidetosi; Mori, Masatake (1974), "Double exponential formulas for numerical integration", Publications of the Research Institute for Mathematical Sciences 9 (3): 721–741, doi:10.2977/prims/1195192451, ISSN 00345318. This paper is also available from here.
External links
 John D. Cook, "Double Exponential Integration" with source code.
 Graeme Dennes, "TanhSinh Quadrature V2.1" A Microsoft Excel workbook containing three functions for performing TanhSinh, Gauss–Kronrod and Romberg numerical integration of functions over the finite interval (a,b), and two functions for performing double exponential (DE) numerical integration of functions over the semiinfinite interval (a,∞), for oscillatory and nonoscillatory functions. Demonstrates the astounding speed and accuracy of the TanhSinh method in particular and the double exponential methods in general, all of which are members of the family of doubleexponential quadrature techniques developed by Takahasi and Mori in 1974. Full open source code is provided, including extensive documentation.
Categories: Numerical integration (quadrature)
Wikimedia Foundation. 2010.