powered by
Search multiple roots of 1D function, sampled/splitted by a (1D) mesh
roots( f, vectorized = FALSE, interval, maxerror_f = 1e-07, split = "seq", split.size = 11, tol = .Machine$double.eps^0.25, .lapply = parallel::mclapply, ... )
array of x, so f(x)=target
Function to find roots
boolean: is f already vectorized ? (default: FALSE) or if function: vectorized version of f.
bounds to inverse in
the maximum error on f evaluation (iterates over uniroot to converge).
function or "unif" or "seq" (default) to preform interval partition
number of parts to perform uniroot inside
the desired accuracy (convergence tolerance on f arg).
control the loop/vectorization over different roots (defaults to multicore apply).
additional named or unnamed arguments to be passed to f.
roots(sin,interval=c(pi/2,5*pi/2)) roots(sin,interval=c(pi/2,1.5*pi/2)) f=function(x)exp(x)-1; f(roots(f,interval=c(-1,2))) f=function(x)exp(1000*x)-1; f(roots(f,interval=c(-1,2)))
Run the code above in your browser using DataLab