Singular Manual: is_composite

| #### D.4.6.3 is_composite Procedure from library `decomp.lib` (see decomp_lib). Usage: is_composite(f); f poly Return: int 1, if f is decomposable 0, if f is not decomposable -1, if char(basering)>0 and deg(f) is divisible by char(basering) but no decomposition has been found. Note: The last case means that it could exist a decomposition f=g o h with char(basering)|deg(g), but this wild case cannot be decided by the algorithm. Some additional information will be displayed when called by the user. Example:
    LIB "decomp.lib";
    ring r0 = 0,x,dp;
    is_composite(x4+5x2+6);    // biquadratic polynomial
    ==> 1
    is_composite(2x2+x+1);     // prime degree
    ==>  The degree is prime.
    ==> 0
    // -----------------------------------------------------------------------
    // polynomial ring with several variables
    ring R = 0,(x,y),dp;
    // -----------------------------------------------------------------------
    // single-variable multivariate polynomials
    is_composite(2x+1);
    ==> 1
    is_composite(2x2+x+1);
    ==> 1
    // -----------------------------------------------------------------------
    // prime characteristic
    ring r7 = 7,x,dp;
    is_composite(compose(ideal(x2+x,x14)));     // is_composite(x14+x7);
    ==> 1
    is_composite(compose(ideal(x14+x,x2)));     // is_composite(x14+x2);
    ==> // -- Warning: wild case, cannot decide whether the polynomial has a
    ==> // -- decomposition goh with deg(g) divisible by char(basering) = 7.
    ==> -1

User manual for Singular version 4.3.2p4, 2023, generated by texi2html.