# Lambert
# Supplying an R function
lambert <- function(x) x * exp(x) - 1
x <- itp(lambert, c(-1, 1))
plot(x)
# Supplying an external pointer to a C++ function
lambert_ptr <- xptr_create("lambert")
x <- itp(lambert_ptr, c(-1, 1))
plot(x, main = "Lambert")
Run the code above in your browser using DataLab