powered by
Finite differences formulas
findiff(f, x, h = x * sqrt(.Machine$double.eps))symdiff(f, x, h = x * .Machine$double.eps^(1/3))findiff2(f, x, h)rdiff(f, x, n = 10, h = 1e-04)
symdiff(f, x, h = x * .Machine$double.eps^(1/3))
findiff2(f, x, h)
rdiff(f, x, n = 10, h = 1e-04)
function to differentiate
the x-value to differentiate at
x
the step-size for evaluation
the maximum number of convergence steps in rdiff
rdiff
the value of the derivative
The findiff formula uses the finite differences formula to find the derivative of f at x. The value of h is the step size of the evaluation. The function findiff2 provides the second derivative.
findiff
f
h
findiff2
# NOT RUN { findiff(sin, pi, 1e-3) symdiff(sin, pi, 1e-3) # }
Run the code above in your browser using DataLab