Function sign_two_roots

Source
pub fn sign_two_roots<T: Arith>(
    p: &T,
    q: &T,
    c: &T,
    r: &T,
    e: &T,
) -> Option<Sign>
Expand description

Sign of p + q*sqrt(c) + r*sqrt(e) for c, e >= 0.

Split as u + v with u = p + q*sqrt(c) and v = r*sqrt(e). If they agree in sign (or one is zero) that is the answer. Otherwise the result is sign(u) * sign(u^2 - v^2), and u^2 - v^2 = (p^2 + q^2*c - r^2*e) + 2*p*q*sqrt(c) is again one root, decided by sign_root.