findiff: Finite Differences

Description Usage Arguments Details Value Examples

View source: R/findiff.R

Description

Finite differences formulas

Usage

1
2
3
4
5
6
7
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)

Arguments

f

function to differentiate

x

the x-value to differentiate at

h

the step-size for evaluation

n

the maximum number of convergence steps in rdiff

Details

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.

Value

the value of the derivative

Examples

1
2
findiff(sin, pi, 1e-3)
symdiff(sin, pi, 1e-3)

cmna documentation built on July 14, 2021, 5:11 p.m.