fn trivial_gcd(f: &Poly, g: &Poly) -> Option<(Poly, Poly, Poly)> {
    match (f.is_zero(), g.is_zero()) {
        (true, true) => Some((poly![], poly![], poly![])),
        (false, true) => Some((f.clone(), poly![], poly![])),
        (true, false) => Some((g.clone(), poly![], poly![])),
        (false, false) => None,
    }
}
/// Handles trivial polynomial GCD cases, namely if one polynomial is empty.
Handles trivial polynomial GCD cases, namely if one polynomial is empty.
Handles trivial polynomial GCD cases namely if one polynomial is empty .
fn trivial_gcd(f: &Poly, g: &Poly) -> Option<(Poly, Poly, Poly)> {
    match (f.is_zero(), g.is_zero()) {
        (true, true) => Some((poly![], poly![], poly![])),
        (false, true) => Some((f.clone(), poly![], poly![])),
        (true, false) => Some((g.clone(), poly![], poly![])),
        (false, false) => None,
    }
}
fn trivial_gcd ( f : & Poly , g : & Poly ) -> Option < ( Poly , Poly , Poly ) > { match ( f . is_zero ( ) , g . is_zero ( ) ) { ( true , true ) => Some ( ( poly ! [ ] , poly ! [ ] , poly ! [ ] ) ) , ( false , true ) => Some ( ( f . clone ( ) , poly ! [ ] , poly ! [ ] ) ) , ( true , false ) => Some ( ( g . clone ( ) , poly ! [ ] , poly ! [ ] ) ) , ( false , false ) => None , } }
Handles trivial polynomial GCD cases, namely if one polynomial is empty.
Handles trivial polynomial GCD cases namely if one polynomial is empty .
f
&Poly
g
&Poly
f
&Poly
g
&Poly