Given a set of datapoints, I was thinking about when to use which (closed) Newton-Cotes formula?
I developed a decision tree which would go like this:
- Are the given datapoints equally spaced? No --> Composite trapezoidal rule
- Yes! Is the number of split-intervals multiple of 4? (ex. 4,8,12,16,..) Yes! ---> Composite Boole's Rule
- No! Is the number of split-intervals multiple of 3? (ex. 3,9,12,15,..) Yes! ---> Composite Simpson's 3/8
- No! Is the number of split-intervals even? (ex. 2,4,6,8,10,..) Yes! ---> Composite Simpson's 1/8
- No! Use composite trapezoidal!
Is it right? If not please correct me. And it would be really helpful, if someone could provide me with the formulas of the composite Simpson's 1/8 and composite Simpson's 3/8, as I am not sure I have the right ones.
And last question: for 3 split-intervals, is it better to use composite trapezoidal rule or 1 simpson's 3/8 rule?
Thank you in advance!