powered by
newton(f, fp, x, tol = 0.001, m = 100)
f
tol
m
bisection
goldsect
gradient
hillclimbing
sa
secant
f <- function(x) { x^3 - 2 * x^2 - 159 * x - 540 } fp <- function(x) {3 * x^2 - 4 * x - 159 } newton(f, fp, 1)
Run the code above in your browser using DataLab