public class RootFinding
extends java.lang.Object
Constructor and Description |
---|
RootFinding() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Double |
bisection(Function f,
double a,
double b,
double tol,
int nMax)
Root-finding algorithm that repeatedly bisects an interval and then selects a subinterval in which a
root must lie for further processing.
|
static java.lang.Double |
brent(Function f,
double a,
double b,
double tol,
double delta,
int nMax)
Root-finding algorithm combining the bisection method, the secant method and inverse quadratic interpolation.
|
static java.lang.Double |
dekker(Function f,
double a,
double b,
double tol,
int nMax) |
static java.lang.Double |
inverseQuadraticInterpolation(Function f,
double x,
double x1,
double x2,
double tol,
int nMax)
Root-finding algorithm that uses quadratic interpolation to approximate the inverse of f.
|
static void |
main(java.lang.String[] args) |
static java.lang.Double |
newton(Function f,
double x,
double x1,
double tol,
int nMax)
Root-finding algorithm that starts with an initial guess which is reasonably close to the true root,
then the function is approximated by its tangent line (which can be computed using the tools of calculus),
and one computes the x-intercept of this tangent line (which is easily done with elementary algebra).
|
static java.lang.Double |
secant(Function f,
double x,
double x1,
double tol,
int nMax)
Root-finding algorithm that uses a succession of roots of secant lines to better approximate
a root of a function f.
|
public static java.lang.Double bisection(Function f, double a, double b, double tol, int nMax)
public static java.lang.Double secant(Function f, double x, double x1, double tol, int nMax)
public static java.lang.Double newton(Function f, double x, double x1, double tol, int nMax)
public static java.lang.Double inverseQuadraticInterpolation(Function f, double x, double x1, double x2, double tol, int nMax)
public static java.lang.Double dekker(Function f, double a, double b, double tol, int nMax)
public static java.lang.Double brent(Function f, double a, double b, double tol, double delta, int nMax)
args
- public static void main(java.lang.String[] args)