# Singular          #### D.12.6.2 weierstrPrep

Procedure from library `weierstr.lib` (see weierstr_lib).

Usage:
weierstrPrep(f,d); f=poly, d=integer

Assume:
f must be general of finite order, say b, in the last ring variable, say T; if not apply the procedure lastvarGeneral first

Purpose:
perform the Weierstrass preparation of f up to order d

Return:
- a list, say l, of two polynomials and one integer,
l a unit, l a Weierstrass polynomial, l an integer such that l*f = l, where l is a Weierstrass polynomial, (i.e. l = T^b + lower terms in T) up to (including) total degree d l is the number of iterations used
- if f is not T-general, return (0,0)

Note:
the procedure works for any monomial ordering

Theory:
the proof of Grauert-Remmert (Analytische Stellenalgebren) is used for the algorithm

Example:
 ```LIB "weierstr.lib"; ring R = 0,(x,y),ds; poly f = xy+y2+y4; list l = weierstrPrep(f,5); l; ""; ==> : ==> 1-x2+xy-y2+3x4-3x3y+3x2y2-2xy3+y4 ==> : ==> xy+y2-x3y ==> : ==> 6 ==> f*l-l; // = 0 up to degree 5 ==> 3x5y+3x4y4-3x3y5+3x2y6-2xy7+y8 ```

### Misc 