FUNCTION :  jac2series   - converts a product of theta functions into
                         a product of q-series.

CALLING SEQUENCE :  jac2series(jacexpr,T)

PARAMETERS :   jacexpr   - product of JAC(i,j, infinity)
                           where i,j are integers
                           and 0 < i < j.
                                 =
SYNOPSIS :   

jac2series(jacexp,T) returns a q-series product which agrees with
the function corresponding to jacexp to O(q^T).

CHANGES :
  1.3: o jac2series can now handle JAC(a,b,infinity) when a<0 or a>b.                                      

EXAMPLES :

> with(qseries):
> x:=tripleprod(q,q^5,10);
         99    81    70    55    46    34    27    18    13    7    4
   x := q   + q   - q   - q   + q   + q   - q   - q   + q   + q  - q  - q + 1
> y:=jacprodmake(x,q,50);
                            y := JAC(1, 5, infinity)
> jac2series(y,50);
             70    55    46    34    27    18    13    7    4
           -q   - q   + q   + q   - q   - q   + q   + q  - q  - q + 1
> J1:=JAC(-4,5,infinity);
                           J1 := JAC(-4, 5, infinity)
> jac2series(J1,20);
                          27    18    13    7    4
                        -q   - q   + q   + q  - q  - q + 1
                      - ----------------------------------
                                         4
                                        q
> J2:=JAC(6,5,infinity);
                           J2 := JAC(6, 5, infinity)
> jac2series(J2,20);
                   46    34    27    18    13    7    4
                  q   + q   - q   - q   + q   + q  - q  - q + 1
                - ---------------------------------------------
                                        q
> XX:=series( (1- theta4(q,60)^2/theta4(q^5,12)^2)/4/q,q,60);
               3    4      5      6    7      8      9       10       11
XX := 1 - q - q  + q  + 4 q  - 4 q  - q  - 3 q  + 3 q  + 12 q   - 12 q   - 2
     12      13      14       15       16      17       18       19       20
    q   - 8 q   + 8 q   + 31 q   - 30 q   - 5 q   - 20 q   + 19 q   + 72 q   -
        21       22       23       24        25        26       27       28
    68 q   - 12 q   - 44 q   + 41 q   + 154 q   - 144 q   - 24 q   - 90 q   +
        29        30        31       32        33        34        35        36
    84 q   + 312 q   - 289 q   - 48 q   - 178 q   + 164 q   + 603 q   - 554 q
           37        38        39         40         41        42        43
     - 92 q   - 336 q   + 307 q   + 1122 q   - 1024 q   - 168 q   - 612 q   +
         44         45         46        47         48        49         50
    557 q   + 2024 q   - 1836 q   - 300 q   - 1087 q   + 983 q   + 3552 q   -
          51        52         53         54         55         56        57
    3206 q   - 522 q   - 1880 q   + 1692 q   + 6088 q   - 5472 q   - 886 q   -
          58      59
    3180 q   + O(q  )
> YY:=jacprodmake(XX,q,50);
                      JAC(1, 10, infinity) JAC(3, 10, infinity)
                YY := -----------------------------------------
                                                    2
                                JAC(5, 10, infinity)
> JJ:=jac2series(YY,60);
        96    64    57    33    28    12    9
JJ := (q   + q   - q   - q   + q   + q   - q  - q + 1)
      88    72    51    39    24    16    7    3        /
    (q   + q   - q   - q   + q   + q   - q  - q  + 1)  /
                                                      /
        80      45      20      5     2
    (2 q   - 2 q   + 2 q   - 2 q  + 1)
> series(JJ-XX,q,60);
                                        59
                                     O(q  )
> Z:=JAC(0,10, infinity);
                           Z := JAC(0, 10, infinity)
> jac2series(Z,50);
                               50    20    10
                              q   - q   - q   + 1

SEE ALSO :  jac2prod, jacprodmake