An exact finite difference (FD) representation of the second-order derivative on three nodes is presented and used to obtain an FD algorithm that allows achieving an arbitrary truncation order. The FD weights are calculated analytically using the series that expresses the field value at a given FD node in terms of the field value and its derivatives at a neighboring node, when a stepwise discontinuity in the refractive index distribution is present between the nodes. The results obtained confirm that the proposed algorithm is accurate, efficient, and achieves the predicted improved performance.