index_line_search(function(x) {(x-100)^2}, 1:290)
index_line_search(function(x) {(-x-100)^2}, -(1:290)^.92, plot="ind")
index_line_search(function(x) {(-x-100)^2}, -(1:290)^.92, plot="x")
xx <- sort(runif(1e2, -250, -30))
index_line_search(function(x) {(-x-100)^2}, xx, plot="ind")
index_line_search(function(x) {(-x-100)^2}, xx, plot="x")
Run the code above in your browser using DataLab