May 10th, 2018, 9:55 am
At this stage it is clear that the method is robust down to the machine level, see Squire&Trapp FORMULA (4).
I suspect you computed f'(x) symbolically(?). If you did it manually I would by very impressed..But it's really boring high-school calculus. In real life exact derivatives are a mirage.
See output and catastrophy with FIRST_ORDER classic FM.
Exact derivative: 0.2967708904695361
Step size, Squire/Trapp, FDM classico
1, 0.346385733136783, 0.04225614025248303
0.1, 0.2996009285356403, 0.2993676773608678
0.01, 0.2967991573202214, 0.2973099839978843
0.001, 0.2967711731345647, 0.2968273693718659
0.0001, 0.2967708932961859, 0.2967765638250963
1e-05, 0.2967708904978026, 0.2967714580637271
1e-06, 0.2967708904698187, 0.2967709471501933
1e-07, 0.296770890469539, 0.296770896746068
1e-08, 0.296770890469536, 0.2967708856438377
1e-09, 0.296770890469536, 0.296770941154989
1e-10, 0.2967708904695361, 0.2967703860434766
1e-11, 0.296770890469536, 0.2967626144823043
1e-12, 0.2967708904695361, 0.2967626144823043
1e-13, 0.296770890469536, 0.2964295475749167
1e-14, 0.296770890469536, 0.2997602166487922
1e-15, 0.296770890469536, 0.333066907387547
1e-16, 0.296770890469536, 0
1e-17, 0.296770890469536, 0
1e-18, 0.296770890469536, 0
1e-19, 0.296770890469536, 0
1e-20, 0.2967708904695361, 0
1e-21, 0.296770890469536, 0
1e-22, 0.296770890469536, 0
1e-23, 0.296770890469536, 0
1e-24, 0.296770890469536, 0
1e-25, 0.296770890469536, 0
1e-26, 0.296770890469536, 0
1e-27, 0.296770890469536, 0
1e-28, 0.296770890469536, 0
1e-29, 0.296770890469536, 0
1e-30, 0.296770890469536, 0
1e-31, 0.296770890469536, 0
1e-32, 0.296770890469536, 0
1e-33, 0.296770890469536, 0
1e-34, 0.296770890469536, 0
1e-35, 0.2967708904695361, 0
1e-36, 0.2967708904695361, 0
1e-37, 0.296770890469536, 0
1e-38, 0.296770890469536, 0
1e-39, 0.296770890469536, 0
1e-40, 0.2967708904695361, 0
1e-41, 0.296770890469536, 0
1e-42, 0.296770890469536, 0
1e-43, 0.296770890469536, 0
1e-44, 0.296770890469536, 0
1e-45, 0.2967708904695361, 0
1e-46, 0.296770890469536, 0
1e-47, 0.296770890469536, 0
1e-48, 0.296770890469536, 0
1e-49, 0.296770890469536, 0
1e-50, 0.296770890469536, 0