Post Reply 
Error propagation in adaptive Simpson algorithm
07-31-2018, 06:37 PM
Post: #5
RE: Error propagation in adaptive Simpson algorithm
Quote:Worse, integral may converge very well, but converged to a wrong result
See above thread post#12, integral of sin(x), from 0 to 200.

Great example, this is a badly behaved integral, all numerical methods will suffer due to massive cancellation.
So I requested a tolerance of 1e-6 and my algorithm converged to a completely wrong value in a couple of seconds. It clearly stopped prematurely, which can happen because of the function, not really anything bad about the algorithm.
Then I requested 8 digits, giving a tolerance of 1E-8. Now it took some time (didn't time it but felt close to a minute) and gave a good answer with 16 digits correct. It seems now the tighter tolerance avoided the premature stop and the algorithm was able to deal with the cancellation of areas. I would've expected all the smaller areas to cancel each other out with errors around 1E-10, to provide a final area close to the 1E-8 requested tolerance, but it seems it had to subdivide a lot to get the result.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Error propagation in adaptive Simpson algorithm - Claudio L. - 07-31-2018 06:37 PM



User(s) browsing this thread: 1 Guest(s)