https://github.com/cran/pracma
Raw File
Tip revision: 71455748623ef69836470c75c5f9384f6e872d45 authored by HwB on 28 June 2011, 00:00:00 UTC
version 0.6-3
Tip revision: 7145574
brentDekker.Rd
\name{brentDekker}
\alias{brentDekker}
\title{
  Brent-Dekker Root Finding Method
}
\description{
Finding roots of univariate functions in bounded intervals.
}
\usage{
brentDekker(f, a, b, ..., maxiter = 100, tol = .Machine$double.eps^0.5)
}
\arguments{
  \item{f}{Function or its name as a string.}
  \item{a}{Left end point of an interval.}
  \item{b}{Right end point of an interval.}
  \item{maxiter}{Maximum number of iterations.}
  \item{tol}{Absolute tolerance.}
  \item{...}{Additional arguments to be passed to f.}
}
\details{
  Well known root finding algorithms for real, univariate, continuous
  functions. The Brent-Dekker approach is a clever combination of secant
  and bisection with quadratic interpolation.
}
\value{
  Brent-Dekker (at the moment) that just returns the root found
  or \code{NA} if the maximum number of iterations has been exceeded..
}
\references{
  Quarteroni, A., R. Sacco, and F. Saleri (2007). Numerical Mathematics.
  Second Edition, Springer-Verlag, Berlin Heidelberg.
}
\author{
  Hans W Borchers  <hwborchers@googlemail.com>
}
\note{
  \code{fzero} in Octave uses a more sophisticated approach with cubic
  interpolation.
}
\seealso{
\code{\link{uniroot}}
}
\examples{
# Legendre polynomial of degree 5
lp5 <- c(63, 0, -70, 0, 15, 0)/8
f <- function(x) polyval(lp5, x)
brentDekker(f, 0.6, 1)  # 0.9061798459 correct to 10 places
}
\keyword{ math }
back to top