HP Forums
Central difference formula comparison- Sharp vs. TI nad Casio - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not remotely HP Calculators (/forum-9.html)
+--- Thread: Central difference formula comparison- Sharp vs. TI nad Casio (/thread-19192.html)



Central difference formula comparison- Sharp vs. TI nad Casio - klesl - 11-23-2022 02:52 PM

TI and Casio calcs use formula in usual form:
f′(x) = (f(x + h) – f(x –h))/(2*h)
Sharp uses a slightly modified formula (it seems there is substituion h=h/2)
f′(x) = (f(x + h/2) – f(x –h/2))/h
Is there some differences in terms of calculation speed, accuracy...?


RE: Central difference formula comparison- Sharp vs. TI nad Casio - robve - 11-23-2022 05:50 PM

(11-23-2022 02:52 PM)klesl Wrote:  Is there some differences in terms of calculation speed, accuracy...?

Short answer: no

The right answer is a long story...

It depends on h, x and the function. But it's all pretty bad, except for textbook cases when the function is nice and smooth. The function may have singularities at \(x \pm h\) or is not defined at the points or not behave well at all. All bets are off with this simple formula.

h is sometimes picked for stability \( h=|x|\sqrt[3]{\varepsilon} \) for nonzero x and MachEps \( \varepsilon \) or \( \sqrt[3]{\varepsilon} \) for example 1e-3.

With Richardson Extrapolation there is more assurance on the result with an error bound. See for example Numerical Recipes.

I wonder why most calculators do not use Richardson Extrapolation? Computational costs are low these days, so no excuses any longer. I could be mistaken, but I believe some Casios do run a numerical extrapolation method (kept secret?).

Some time ago I've derived a better method than Richardson, one that appears to be more numerically stable empirically.

- Rob