# What is the best state-of-the-art numerical integral algorithm?

I'm trying to implement a numerical integrator that should have the minimum relative error and is not slow. So I was looking for the best accepted state-of-the-art algorithm to do so but there seems to be so many approaches that I could not understand which one should I choose. So I'm turning to you for a recommendation.

-
I suggest you try adaptive quadrature. – lhf Apr 17 '12 at 12:30
There is no such thing as "one algorithm to evaluate them all". Methods for "nice integrals" are quite different from methods for, say, infinite oscillatory integrals, or Cauchy principal value integrals. That's why there are a lot of algorithms, since families of integrals might carry their own unique set of difficulties. – J. M. Apr 17 '12 at 12:31
Yes, and that is precisely the route taken by packages like QUADPACK... – J. M. Apr 17 '12 at 13:10
Offhand: check for singularities. Improper integrals often require special methods. Functions with rapidly decaying or very oscillatory factors also need special treatment. Discontinuous functions require splitting at discontinuities. Everything else is fair game for adaptive quadrature. – J. M. Apr 17 '12 at 13:37
Well, not my fault that you weren't specific at the outset, no? Efficient cubature methods remain an active area of research, and unless you have the expertise, I caution against rolling out your own implementation. You will want to look at the work already done by Ronald Cools and Terje Espelid. – J. M. Apr 17 '12 at 13:47

As @J.M noted, there are many methods, each suited for a certain purpose. If you don't know what the function are in advance, then for low-dimensional ($d < 3$) integrals a adaptive Gauss–Kronrod rule quadrature is probably the fastest.
In any case, if the OP wants $d > 3$, neither of these will work. – nbubis Apr 17 '12 at 13:42