Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

roots

One Dimensional Multiple Roots (Zero) Finding


Description

Search multiple roots of 1D function, sampled/splitted by a (1D) mesh

Usage

roots(
  f,
  interval,
  maxerror_f = 1e-07,
  split = "seq",
  split.size = 11,
  tol = .Machine$double.eps^0.25,
  ...
)

Arguments

f

Function to find roots

interval

bounds to inverse in

maxerror_f

the maximum error on f evaluation (iterates over uniroot to converge).

split

function or "unif" or "seq" (default) to preform interval partition

split.size

number of parts to perform uniroot inside

tol

the desired accuracy (convergence tolerance on f arg).

...

additional named or unnamed arguments to be passed to f.

Value

array of x, so f(x)=target

Examples

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)))

DiceView

Methods for Visualization of Computer Experiments Design and Surrogate

v2.0-1
GPL-3
Authors
Yann Richet, Yves Deville, Clement Chevalier
Initial release
2020-11-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.