Small Solver Program
|
02-18-2019, 05:20 AM
Post: #16
|
|||
|
|||
RE: Small Solver Program
If you compare your algorithm with Newton's method:
\(x_{n+1}=x_{n}-\frac {f(x_{n})}{f'(x_{n})}\) you may notice that the number in register 0 should in fact be \(f'(x_{n})\) or at least a good approximation thereof. And with this in mind indeed the solution can now be found: \(f'(x) = \frac{d}{dx}4 x (x + 1) = 8 x + 4\) \(f'(-1) = -4\) \(f'(0) = 4\) Examples: -1.5 ENTER -4 A -1.00000 0.5 ENTER 4 A 0.00000 Thus your 2nd parameter is an estimate of the slope at the root. And then you don't really have to call the function twice with the same value: Code: LBL A So the question remains how to approximate the derivation at the roots. If you keep record of the previous function evaluation you can get an estimate of the slope using the secant method. Cheers Thomas |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)