numerics
Loading...
Searching...
No Matches
roots.cpp File Reference
#include "analysis/roots.hpp"
#include <cmath>
#include <stdexcept>

Go to the source code of this file.

Namespaces

namespace  num
 

Functions

RootResult num::bisection (ScalarFn f, real a, real b, real tol=1e-10, idx max_iter=1000)
 Bisection method.
 
RootResult num::newton (ScalarFn f, ScalarFn df, real x0, real tol=1e-10, idx max_iter=1000)
 Newton-Raphson method.
 
RootResult num::secant (ScalarFn f, real x0, real x1, real tol=1e-10, idx max_iter=1000)
 Secant method (Newton without derivative)
 
RootResult num::brent (ScalarFn f, real a, real b, real tol=1e-10, idx max_iter=1000)
 Brent's method (bisection + secant + inverse quadratic interpolation)