[][src]Function roots::find_roots_biquadratic

pub fn find_roots_biquadratic<F: FloatType>(a4: F, a2: F, a0: F) -> Roots<F>

Solves a bi-quadratic equation a4x^4 + a2x^2 + a0 = 0.

Returned roots are arranged in the increasing order.

Examples

use roots::find_roots_biquadratic;

let no_roots = find_roots_biquadratic(1f32, 0f32, 1f32);
// Returns Roots::No([]) as 'x^4 + 1 = 0' has no roots

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

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