Compact Simpson's Rule
|
12-13-2015, 02:06 AM
(This post was last modified: 12-13-2015 02:12 AM by Namir.)
Post: #1
|
|||
|
|||
Compact Simpson's Rule
This listing calculates the integral for f(X)=1/X (see label E) using Simpson's rule. The code is based on the compact pseudo-code that I posted in a thread in the General area.
Code: Memory Map |
|||
12-13-2015, 07:13 AM
Post: #2
|
|||
|
|||
RE: Compact Simpson's Rule | |||
12-13-2015, 02:20 PM
(This post was last modified: 12-13-2015 02:26 PM by Dieter.)
Post: #3
|
|||
|
|||
RE: Compact Simpson's Rule
(12-13-2015 02:06 AM)Namir Wrote: This listing calculates the integral for f(X)=1/X (see label E) using Simpson's rule. The code is based on the compact pseudo-code that I posted in a thread in the General area. Here's my version with yet another method of toggling between 2* and 4*f(x): use a flag. This also frees up one register, and even one more can be saved as once h is calculated the value of b is no longer required. So that's two registers less and some bytes of code saved. And one function call as f(b) is not calculated twice. Code: 01 LBL "SIMP" Maybe t's also fun to watch the flashing "2" annunciator. ;-) Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)