viete formula partly ported using multinomials.