Numerical differentiation using forward difference method

165 Views Asked by At

I am trying to calculate the fourth derivative of order $O(h^2)$ and $O(h^4)$ of any function $f$, through the forward finite difference method, and which coefficients are given in this Wikipedia's article

https://en.wikipedia.org/wiki/Finite_difference_coefficient

I wrote this code considering such article enter image description here

However, in non of both i get the result should be.