Example 1:
> p = taylor(exp(x),5,0);
> s = subpoly(p,[|1,3,5|]);
> print(p);
1 + x * (1 + x * (0.5 + x * (1 / 6 + x * (1 / 24 + x / 120))))
> print(s);
x * (1 + x^2 * (1 / 6 + x^2 / 120))
Example 2:
> p = remez(atan(x),10,[-1,1]);
> subpoly(p,[|1,3,5...|]);
x * (0.99986632941452949026018468446163586361700915018231 + x^2 * (-0.33030478502455936362667794059988443130926433421739 + x^2 * (0.18015929317818756462894237037824735129130095574422 + x * (2.28455841154247882851125015653585766424298569630719e-9 + x * (-8.5156349064111377895500552996061844977507560037484e-2 + x * (-2.71756340962775019916818769239340943524383018921799e-9 + x * (2.08451134307114729373239910549169872454686955894998e-2 + x * 1.10889861181129057657199664386826630081793400489512e-9)))))))
Example 3:
> subpoly(exp(x),[|1,2,3|]);
0