def rs_newton(p, x, prec):
 deg = p.degree()
 p1 = _invert_monoms(p)
 p2 = rs_series_inversion(p1, x, prec)
 p3 = rs_mul(p1.diff(x), p2, x, prec)
 res = (deg - (p3 * x))
 return res

def rs_newton ( p , x , prec ) : deg = p . degree ( ) p1 = _invert_monoms ( p ) p2 = rs_series_inversion ( p1 , x , prec ) p3 = rs_mul ( p1 . diff ( x ) , p2 , x , prec ) res = ( deg - ( p3 * x ) ) return res
compute the truncated newton sum of the polynomial p examples .