f <- function(x) log(x)
domain <- c(1, 10)
res <- adaptive_pwl_fit(f, domain, tol = 1e-4, initial_points = 10, smallconst = 0.01)
cat("x,y\n")
for(i in 1:nrow(res$data)) {
cat(paste(res$data[i, 1], res$data[i, 2], sep = ","), "\n")
}
Run the code above in your browser using DataLab