An ODE-based method for computing the approximate greatest common divisor of polynomials