Post Reply 
(35S) 2nd order Derivative (at a point)
11-10-2020, 11:23 PM (This post was last modified: 11-11-2020 04:39 AM by trojdor.)
Post: #3
RE: (35S) 2nd order Derivative (at a point)
(11-10-2020 02:20 PM)Albert Chan Wrote:  
(11-09-2020 09:51 PM)trojdor Wrote:  EXAMPLE
If f(x)= x^3 + 5*x^2 - 21*x
Calcuate f"(x) at x=4

This is a bad example to test effect of h on 2nd derivative estimate.

Albert, thank you for your response, and for pointing that out.
What would you suggest as a good example?

(11-10-2020 02:20 PM)Albert Chan Wrote:  For fair comparison, let's try both ways for f'(4), with same h = 1E-3:

XCas> (f(x+h) - f(x)) / h | x=4, h=1E-3                → 67.017001
XCas> (f(x+h) - f(x-h)) / (2*h) | x=4, h=1E-3       → 67.000001

Well, to be really fair, let's try on the 35s with h=1E-6 as used in his pgm:
(f(x+h) - f(x)) / h | x=4, h=1E-6                         → 67.0000000000
(f(x+h) - f(x-h)) / (2*h) | x=4, h=1E-6                → 67.0000000000

Which is why I stated that I could see no real/practical benefit to replacing the smaller Zuleta pgm with a larger program that ends up with the same practical accuracy (to 10 decimal places) on the HP 35s.

This program was written for the HP 35s to assist in the NCEES / Fundamentals of Engineering Licensing Exam. (The only HP/RPN calculator allowed on the exam is the HP 35s.)
Thus my focus tends to be more engineering/results oriented, as opposed to the theoretical.

However, I truly do appreciate your response/advice/feedback....thanks so much!
(And I'm always up for learning something new.)
Smile
...now I'm off to experiment with your idea of splitting f(x) to minimize rounding errors...

ENTER > =
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (35S) 2nd order Derivative (at a point) - trojdor - 11-10-2020 11:23 PM



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