fzero: A function used to get the root by the method of bisection

Description Usage Arguments Value Examples

View source: R/fzero.R

Description

This function is used to calculate the root of a equation in a interval and you need promise the signs at both ends of the interval are opposite or it will fail

Usage

1
fzero(f, a, b, eps = 1e-05)

Arguments

f

the equation which We need to find the root

a

The right endpoint of the interval at the root of the equation

b

The right endpoint of the interval at the root of the equation

eps

Iteration is stopped when both ends of the interval are less than eps

Value

a root of the equation

Examples

1
2
3
4
5
6
f<-function(x) x^3-x-1
fzero(f, 1, 2, 1e-6)
## Not run: 
fzero(f, 0, 1, 1e-6)

## End(Not run)

Panxiaoba/StatComp18013 documentation built on May 5, 2019, 11:06 p.m.