The most compact algorithm for Simpson's rule??
|
12-12-2015, 04:24 PM
(This post was last modified: 12-12-2015 10:58 PM by Namir.)
Post: #1
|
|||
|
|||
The most compact algorithm for Simpson's rule??
Here is a (corrected, based on feedback from site members) pseudo code for what I hope to be the most compact way to implement Simpson's rule:
Code:
Many implementations use two summations--one for odd terms and one for even terms. In addition these implementations use two loops with slightly different ranges. The above pseudo-coode implements a simple version that uses one loop and a few simple computational tricks. Namir |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)