### univariate taylor series (in x=0)
taylor("exp(x)", var = "x", order = 2)
### univariate taylor series of user-defined functions (in x=0)
f <- function(x) exp(x)
taylor(f = f, var = c(x=0), order = 2)
### multivariate taylor series (in x=0 and y=1)
taylor("x*(y-1)", var = c(x=0, y=1), order = 4)
### multivariate taylor series of user-defined functions (in x=0 and y=1)
f <- function(x,y) x*(y-1)
taylor(f, var = c(x=0, y=1), order = 4)
### vectorized interface
f <- function(x) prod(x)
taylor(f, var = c(0,0,0), order = 3)
Run the code above in your browser using DataLab