Berend Hasselman wrote > > ..... > > g <- function(x){ > out <- (2/(3))*exp(x^2)-(20)*log(x) > return(out) > } > > gp <- function(x) { > out <- (4/3)*exp(x) - 20/x > return(out) > } >
function gp is incorrect. It should be gp <- function(x) { out <- (4/3)*x*exp(x^2) - 20/x return(out) } Berend -- View this message in context: http://r.789695.n4.nabble.com/NEWTON-ALGORITHM-tp4224558p4225321.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.