newton_root: Find root of a function using combination of small_step...

View source: R/numeric.R

newton_rootR Documentation

Find root of a function using combination of small_step method and newton method.

Description

Returns roots of a focal function by checking the sign change in each step.

Usage

newton_root(func, step, ...)

Arguments

func

the function for which the root is sought.

step

a vector containing the step values

...

optional arguments to be passed to "func"

Value

a vector which containing root values

Examples

f = function(x,y){return(x*x-y*x)}
ans = newton_root(f, seq(-2,2,length=1001),y=1.333)
#ans == c(0.000,1.333)

hmito/hmRLib documentation built on March 13, 2024, 9:41 p.m.