## Name:

subpoly restricts the monomial basis of a polynomial to a list of monomials

## Usage:

subpoly(polynomial, list) : (function, list) -> function

## Parameters:

• polynomial represents the polynomial the coefficients are taken from
• list represents the list of monomials to be taken

## Description:

• subpoly extracts the coefficients of a polynomial polynomial and builds up a new polynomial out of those coefficients associated to monomial degrees figuring in the list list.

If polynomial represents a function that is not a polynomial, subpoly returns 0.

If list is a list that is end-elliptic, let be j the last value explicitly specified in the list. All coefficients of the polynomial associated to monomials greater or equal to j are taken.

## 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.99986632946591986997581285958052433296267358727229 + x^2 * (-0.330304785504861260596093435534236137298206064685038 + x^2 * (0.180159294636523467997437751178959039617773054107393 + x * (-1.21704858321866028906175835649390114311877360260197e-14 + x * (-8.5156350833702702996505336803770858918120961566741e-2 + x * (1.39681284176342339364451388757935358048374878126733e-14 + x * (2.0845114175434561643018447784809880955983412532269e-2 + x * (-5.6810131012579436265697622426011349460288598691964e-15))))))))

## Example 3:

> subpoly(exp(x),[|1,2,3|]);
0