bisect(f, a, b, maxiter = 100, tol = .Machine$double.eps^0.5)regulaFalsi(f, a, b, maxiter = 100, tol = .Machine$double.eps^0.5)
eps^(1/2)
root
, f.root
,
the function value at the found root, iter
, the number of iterations
done, and root
, and the estimated accuracy estim.prec
``Regula falsi'' combines bisection and secant methods. The so-called `Illinois' improvement is used.
ridders
# Legendre polynomial of degree 5
lp5 <- c(63, 0, -70, 0, 15, 0)/8
f <- function(x) polyval(lp5, x)
bisect(f, 0.6, 1) # 0.9061798453 correct to 9 decimals
regulaFalsi(f, 0.6, 1) # 0.9061798459 correct to 10 decimals
Run the code above in your browser using DataLab