[][src]Function roots::find_roots_quartic_depressed

pub fn find_roots_quartic_depressed<F: FloatType>(
    a2: F,
    a1: F,
    a0: F
) -> Roots<F>

Solves a depressed quartic equation x^4 + a2x^2 + a1x + a0 = 0.

Returned roots are ordered. Precision is about 1e-14 for f64.

Examples

use roots::find_roots_quartic_depressed;

let one_root = find_roots_quartic_depressed(1f64, 0f64, 0f64);
// Returns Roots::One([0f64]) as 'x^4 = 0' has one root 0

let two_roots = find_roots_quartic_depressed(1f32, 0f32, -1f32);
// Returns Roots::Two([-1f32, 1f32]) as 'x^4 - 1 = 0' has roots -1 and 1