def dup_gcdex(f, g, K):
 (s, h) = dup_half_gcdex(f, g, K)
 F = dup_sub_mul(h, s, f, K)
 t = dup_quo(F, g, K)
 return (s, t, h)

def dup_gcdex ( f , g , K ) : ( s , h ) = dup_half_gcdex ( f , g , K ) F = dup_sub_mul ( h , s , f , K ) t = dup_quo ( F , g , K ) return ( s , t , h )
extended euclidean algorithm in f[x] .