A simple, reliable and efficient scheme for automatic numerical integration