Cubic

Type Alias Cubic 

Source
pub type Cubic = Poly<4>;
Expand description

A polynomial of degree 3.

Aliased Type§

pub struct Cubic { /* private fields */ }

Implementations§

Source§

impl Cubic

Source

pub fn roots_between( self, lower: f64, upper: f64, x_error: f64, ) -> ArrayVec<f64, 3>

Computes all roots between lower and upper, to the desired accuracy.

We make no guarantees about multiplicity. In fact, if there’s a double-root that isn’t a triple-root (and therefore has no sign change nearby) then there’s a good chance we miss it altogether. This is fine if you’re using this root-finding to optimize a quartic, because double-roots of the derivative aren’t local extrema.