derv: Derivative using the Cauchy integral formula.

Description Usage Arguments Details Value Author(s) Examples

Description

Evaluates n-th order derivative of a real- or complex-valued function where n is a non-zero natural number.

Usage

1
derv(func, x0, n = 1, complex = FALSE , tol= .Machine$double.eps^0.5)

Arguments

func

A real- or complex-valued function. The function must be analytic at z0.

x0

A scalar or vector at which the derivative is evaluated.

n

A non-zero natural number.

complex

If TRUE, complex-valued output is returned. If the evaluated derivative is complex but complex=TRUE, only the real part is returned.

tol

Relative tolerance in calculating the integral. This is the one in the R built-in function integrate.

Details

Derivative using the Cauchy integral formula.

Value

A real- or complex-valued scalar or vector.

Author(s)

Char Leung

Examples

1
2
derv(function(x){x^3},x0=2,n=2)
derv(function(z){sin(z^2)/cos(1/z)},1)

ComplexAnalysis documentation built on Jan. 15, 2017, 10:24 a.m.