

def dup_qq_heu_gcd(f, g, K0):
    '\n    Heuristic polynomial GCD in `Q[x]`.\n\n    Returns ``(h, cff, cfg)`` such that ``a = gcd(f, g)``,\n    ``cff = quo(f, h)``, and ``cfg = quo(g, h)``.\n\n    Examples\n    ========\n\n    >>> from sympy.polys import ring, QQ\n    >>> R, x = ring("x", QQ)\n\n    >>> f = QQ(1,2)*x**2 + QQ(7,4)*x + QQ(3,2)\n    >>> g = QQ(1,2)*x**2 + x\n\n    >>> R.dup_qq_heu_gcd(f, g)\n    (x + 2, 1/2*x + 3/4, 1/2*x)\n\n    '
    result = _dup_ff_trivial_gcd(K1, g, K0)
    if (result is not None):
        return result
    K1 = K0.get_ring()
    (cf, f) = dup_clear_denoms(f, K0, K1)
    (cg, g) = dup_clear_denoms(g, K0, K1)
    f = dup_convert(f, K0, K1)
    g = dup_convert(g, K0, K1)
    (h, cff, cfg) = dup_zz_heu_gcd(f, g, K1)
    h = dup_convert(h, K1, K0)
    c = dup_LC(h, K0)
    h = dup_monic(h, K0)
    cff = dup_convert(cff, K1, K0)
    cfg = dup_convert(cfg, K1, K0)
    cff = dup_mul_ground(cff, K0.quo(c, cf), K0)
    cfg = dup_mul_ground(cfg, K0.quo(c, cg), K0)
    return (h, cff, cfg)

dataset/ETHPy150Open sympy/sympy/sympy/polys/euclidtools.py dup_qq_heu_gcd/VarMisuse@20/286 `f`->`K1`