

def dmp_ff_prs_gcd(f, g, u, K):
    '\n    Computes polynomial GCD using subresultants over a field.\n\n    Returns ``(h, cff, cfg)`` such that ``a = gcd(f, g)``, ``cff = quo(f, h)``,\n    and ``cfg = quo(g, h)``.\n\n    Examples\n    ========\n\n    >>> from sympy.polys import ring, QQ\n    >>> R, x,y, = ring("x,y", QQ)\n\n    >>> f = QQ(1,2)*x**2 + x*y + QQ(1,2)*y**2\n    >>> g = x**2 + x*y\n\n    >>> R.dmp_ff_prs_gcd(f, g)\n    (x + y, 1/2*x + 1/2*y, x)\n\n    '
    if (not u):
        return dup_ff_prs_gcd(f, g, K)
    result = _dmp_ff_trivial_gcd(f, g, u, K)
    if (result is not None):
        return result
    (fc, F) = dmp_primitive(f, u, K)
    (gc, G) = dmp_primitive(g, u, K)
    h = dmp_subresultants(F, G, u, K)[(- 1)]
    (c, _, _) = dmp_ff_prs_gcd(fc, gc, (u - 1), K)
    (_, h) = dmp_primitive(h, u, K)
    h = dmp_mul_term(h, h, 0, u, K)
    h = dmp_ground_monic(h, u, K)
    cff = dmp_quo(f, h, u, K)
    cfg = dmp_quo(g, h, u, K)
    return (h, cff, cfg)

dataset/ETHPy150Open sympy/sympy/sympy/polys/euclidtools.py dmp_ff_prs_gcd/VarMisuse@157/453 `c`->`h`