Finite difference methods for estimating derivatives in Racket. The API is loosely based on that of fdm and FiniteDifferences.jl (née FDM.jl). This package provides a small subset of the functionality provided by those.
(forward-grid p)
(backward-grid p)
(central-grid p)
These functions define the grids for a forward, backward, or central finite difference
method of order p
.
(dfdx g p q f x
#:adapt
#:condition
#:eps
#:bound)
Compute the q
th derivative of the univariate, real-valued function f
at x
using a
finite difference method of order p
with a grid defined by g
.
g
should be one of the aforementioned functions.
The keyword arguments are:
adapt
: The number of adaptive steps to use to improve the estimate ofbound
. Defaults to 1. Set to 0 to disable adaptive bound computation.condition
: The condition number used when computing bounds. Defaults to 100.eps
: The assumed roundoff error. Defaults toepsilon.0
.bound
: Bound on the value of the functionf
and its derivatives atx
. This value is computed and should not generally need to be specified.