Dear Richy, On Mon, 2005-09-12 at 22:16 +0200, Richard B. Kreckel wrote:
1) Why the decision to *not* couple the precision to the value of Digits? Coupling it to Digits would make it available in Ginsh. Wouldn't it do the right thing in almost all cases?
It depends on what coupling you have in mind. As different users may have different preferences, I thought it was best to leave it up to the user. Note that it would be a highly dangerous idea to make the precision of integration equal to the precision of the other numerical calculations. This is because the last few digits of a calculated number may not be very trustworthy and all kind of artifacts could be in them. A continuous function could look non-continuous depending on the algorithm used for calculation. Then the adaptive simpson method would go *boink*.
2) Are variations of Simpson's rule really attractive for numerical evaluation? Have you considered/tried something funkier (maybe Romberg's method) or is that a particularly smart implementation?
I thought it was quite nice. Convergence as 1/N^4 and adaptivity. It has been some time that I looked at this, so I forgot why I took the adaptive Simpson algorithm. Presumably there was something in the book by Burden and Faires that made me go for the adaptive Simpson algorithm. Unfortunately I do not have that book now that I am in Milan and the library seems to be reorganizing until december or so :-(. Of course, there could also be an integral::integration_method to give the user a choice what method to use.
3) Probably an oversight: the last argument to the adaptivesimpson function is unused. Instead, the code always uses the default.
Yes, the obvious fix for this is to turn all occurances of integral::relative_integration_error into error. Could you do this in CVS? Best wishes, Chris