Message #12 Posted by Wes Loewer on 4 Nov 2011, 3:34 p.m.,
in response to message #5 by Kiyoshi Akima
My personal preference would be for some kind of locally-adaptive routine. I've always considered the lack of local adaptivity one of the most serious flaws in the Romberg-based routine used from the HP 34C to the HP 50g (and the 15C LE, if I'm going to mention the most chronologically recent).
I agree. The Romberg method made perfect sense for the 34C with its limited memory. In the article, Kahan states: "For example, consider Gaussian quadrature. This method is widely regarded as 'best' in the sense that it very often requires fewer samples than most other methods to achieve an average A that approximates the desired A to within some preassigned tolerance." He goes on to explain why Gauss was not used as it would have taken all the calculator's memory to store the necessary nodes and weights.
Now that calculators have more memory, the widely used Gauss-Kronrod method seems well suited. I don't know how tight memory is on the 34S, but if you can fit something like Gauss-Kronrod onto it, it would be worth it. Romberg works fine for well-behaved functions, but it really bogs down on functions with cusps or corners. It reiterates deeper and deeper on the entire function intead of just where the problem is.
Functions with corners from absolute values are common when calculating the distance traveled given the velocity function:
d = integral abs(v(x)) dx.
I came across such an integral on a standardized exam that would have taken over 30 minutes on the 50g in the default STD mode. (Students had 50 minutes to answer 17 calculator based questions on that section of the exam.) Setting the mode to FIX 5 reduces the time to about 30 seconds, but for comparison, the slower ti-84+, which uses the 15 node GK method, takes about 6 seconds.
The recursive 15 node Gauss-Kronrod method is commonly used, but if memory is tight, fewer nodes could be used. Because of symmetry, the 15 node GK requires storage of 8 node values and 12 weight values for a total of 20 values. A 7 node version would require 4 node values and 6 weights for a total of 10 values.