Go to the source code of this file.
|
| template<std::invocable< double > T> |
| double | ridders (const T &func, double x1, double f1, double x2, double f2, const double tolerance) |
| | Implements Ridders' method for finding the root of a function.
|
| |
| template<std::invocable< double > T> |
| double | ridders (const T &func, double x1, double x2, const double tolerance) |
| |
| template<std::invocable< double > T> |
| double | ridders_guess (const T &func, double x1, double f1, double x2, double f2, const double tolerance) |
| |
| template<std::invocable< double > T> |
| double | ridders_guess (const T &func, double x1, double x2, const double tolerance) |
| |
◆ ridders() [1/2]
template<std::invocable< double > T>
| double ridders |
( |
const T & |
func, |
|
|
double |
x1, |
|
|
double |
f1, |
|
|
double |
x2, |
|
|
double |
f2, |
|
|
const double |
tolerance |
|
) |
| |
Implements Ridders' method for finding the root of a function.
Ridders' method is a root-finding algorithm that combines the bisection method with an exponential interpolation to achieve quadratic convergence under ideal conditions.
- Template Parameters
-
| T | A callable type that takes a double as input and returns a double. |
- Parameters
-
| func | The function for which the root is to be found. It must be callable with a double argument. |
| x1 | The first initial guess for the root. |
| f1 | The value of the function at x1 (i.e., func(x1)). |
| x2 | The second initial guess for the root. |
| f2 | The value of the function at x2 (i.e., func(x2)). |
| tolerance | The tolerance for the root-finding process. |
- Returns
- The estimated root of the function within the specified tolerance.
◆ ridders() [2/2]
template<std::invocable< double > T>
| double ridders |
( |
const T & |
func, |
|
|
double |
x1, |
|
|
double |
x2, |
|
|
const double |
tolerance |
|
) |
| |
◆ ridders_guess() [1/2]
template<std::invocable< double > T>
| double ridders_guess |
( |
const T & |
func, |
|
|
double |
x1, |
|
|
double |
f1, |
|
|
double |
x2, |
|
|
double |
f2, |
|
|
const double |
tolerance |
|
) |
| |
◆ ridders_guess() [2/2]
template<std::invocable< double > T>
| double ridders_guess |
( |
const T & |
func, |
|
|
double |
x1, |
|
|
double |
x2, |
|
|
const double |
tolerance |
|
) |
| |