[−][src]Crate roots
A set of functions to find real roots of numerical equations.
This crate contains various algorithms for numerical and analytical solving of 1-variable equations like f(x)=0. Only real roots are calculated. Multiple (double etc.) roots are considered as one root.
Use
Functions find_root_* try to find a root of any given closure function by iterative approximations. Conditions for success/failure can be customized by implementing the Convergency trait. Functions find_roots_* return all roots of several simple equations at once.
Structs
DebugConvergency | Convergency provider for debugging. It will print out the error at each iteration. |
Interval | Interval between two samples, including these samples |
Parabola | Definition of the quadratic equation ax^2 + bx + c |
Sample | Pair of the independent variable x and the function value y=F(x) |
SimpleConvergency | A very basic convergency rules that must be sufficient for many cases. The absolute precision is the same for x and y axes, no relative precision. |
Enums
Roots | Sorted and unique list of roots of an equation. |
Traits
Convergency | The way to check if the algorithm has finished by either finding a root or reaching the iteration limit. |
FloatType | Generic type that lists functions and constants needed in calculations. Default implementations for f32 and f64 are provided. |
Functions
find_root_brent | Find a root of the function f(x) = 0 using the Brent method. |
find_root_inverse_quadratic | Find a root of the function f(x) = 0 using inverse quadratic approximation. |
find_root_newton_raphson | Find a root of the function f(x) = 0 using the Newton-Raphson method. |
find_root_regula_falsi | Find a root of the function f(x) = 0 using the Illinois modification of the regula falsi method. |
find_root_secant | Find a root of the function f(x) = 0 using the secant method. |
find_roots_biquadratic | Solves a bi-quadratic equation a4x^4 + a2x^2 + a0 = 0. |
find_roots_cubic | Solves a cubic equation a3x^3 + a2x^2 + a1*x + a0 = 0. |
find_roots_cubic_depressed | Solves a depressed cubic equation x^3 + a1*x + a0 = 0. |
find_roots_cubic_normalized | Solves a normalized cubic equation x^3 + a2x^2 + a1x + a0 = 0. |
find_roots_eigen | Find all roots of the normalized polynomial by finding eigen numbers of the corresponding matrix. (Converted from Java by stiv-yakovenko) |
find_roots_linear | Solves a linear equation a1*x + a0 = 0. |
find_roots_quadratic | Solves a quadratic equation a2x^2 + a1x + a0 = 0. |
find_roots_quartic | Solves a quartic equation a4x^4 + a3x^3 + a2x^2 + a1x + a0 = 0. |
find_roots_quartic_depressed | Solves a depressed quartic equation x^4 + a2x^2 + a1x + a0 = 0. |
find_roots_sturm | Find all roots of the normalized polynomial x^n + a[0]*x^(n-1) + a[1]*x^(n-2) + ... + a[n-1] = 0 using the Sturm's theorem recursively. |