Name:

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

Library name:

sollya_obj_t sollya_lib_subpoly(sollya_obj_t, sollya_obj_t)

Usage:

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

Parameters:

Description:

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 * 1 / 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.99986632941452949026018468446163586361700915018232 + x^2 * (-0.33030478502455936362667794059988443130926433421739 + x^2 * (0.18015929317818756462894237037824735129130095574422 + x * (2.2845584115424788285112501565358576642429856963072e-9 + x * (-8.5156349064111377895500552996061844977507560037485e-2 + x * (-2.717563409627750199168187692393409435243830189218e-9 + x * (2.08451134307114729373239910549169872454686955895e-2 + x * 1.10889861181129057657199664386826630081793400489512e-9)))))))

Example 3:

   > subpoly(exp(x),[|1,2,3|]);
   0
See also: roundcoefficients, taylor, remez, fpminimax, implementpoly
Go back to the list of commands