diff --git a/books/bookvol10.3.pamphlet b/books/bookvol10.3.pamphlet index a5ab298..d482750 100644 --- a/books/bookvol10.3.pamphlet +++ b/books/bookvol10.3.pamphlet @@ -47354,25 +47354,29 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where refer := ref(eFcn(degr) :: COM) makeSeries(refer,iMap1(cFcn,eFcn,check?,x,xRefer,refer,degr + 1)) - map(fcn,x) == iMap2(fcn(#1),#1,true,x) - differentiate x == iMap2(#2 * #1,#1 - 1,true,x) - multiplyCoefficients(f,x) == iMap2(f(#2) * #1,#1,true,x) - multiplyExponents(x,n) == iMap2(#1,n * #1,false,x) + map(fcn,x) == iMap2((y,n) +-> fcn(y), z +->z, true, x) + differentiate x == iMap2((y,n) +-> n*y, z +-> z - 1, true, x) + multiplyCoefficients(f,x) == iMap2((y,n) +-> f(n)*y, z +-> z, true, x) + multiplyExponents(x,n) == iMap2((y,m) +-> y, z +-> n*z, false, x) iPlus1(op,x,xRefer,y,yRefer,refer,n) == delay -- when this function is called, all terms in 'x' and 'y' of order < n -- have been computed and we are computing the nth order coefficient of -- the result; note the 'op' is either '+' or '-' - explicitlyEmpty? x => iMap1(op(0,#1),#1,false,y,yRefer,refer,n) - explicitlyEmpty? y => iMap1(op(#1,0),#1,false,x,xRefer,refer,n) + explicitlyEmpty? x => + iMap1((x1,m) +-> op(0,x1), z +-> z, false, y, yRefer, refer, n) + explicitlyEmpty? y => + iMap1((x1,m) +-> op(x1,0), z +-> z, false, x, xRefer, refer, n) -- if terms up to order n have not been computed, -- apply lazy evaluation nn := n :: COM while (elt xRefer) < nn repeat lazyEvaluate x while (elt yRefer) < nn repeat lazyEvaluate y -- 'x' or 'y' may now be empty: retest - explicitlyEmpty? x => iMap1(op(0,#1),#1,false,y,yRefer,refer,n) - explicitlyEmpty? y => iMap1(op(#1,0),#1,false,x,xRefer,refer,n) + explicitlyEmpty? x => + iMap1((x1,m) +-> op(0,x1), z +-> z, false, y, yRefer, refer, n) + explicitlyEmpty? y => + iMap1((x1,m) +-> op(x1,0), z +-> z, false, x, xRefer, refer, n) -- must have nx >= n, ny >= n -- both x and y have explicit terms explicitEntries?(x) and explicitEntries?(y) => @@ -47419,30 +47423,30 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where iPlus2(op,ups1,ups2) == xRefer := getRef ups1; x := getStream ups1 xDeg := - explicitlyEmpty? x => return map(op(0$Coef,#1),ups2) + explicitlyEmpty? x => return map(z +-> op(0$Coef,z),ups2) explicitEntries? x => (getExpon frst x) - 1 -- can't have elt(xRefer) = infty unless all terms have been computed retract(elt xRefer)@I yRefer := getRef ups2; y := getStream ups2 yDeg := - explicitlyEmpty? y => return map(op(#1,0$Coef),ups1) + explicitlyEmpty? y => return map(z +-> op(z,0$Coef),ups1) explicitEntries? y => (getExpon frst y) - 1 -- can't have elt(yRefer) = infty unless all terms have been computed retract(elt yRefer)@I deg := min(xDeg,yDeg); refer := ref(deg :: COM) makeSeries(refer,iPlus1(op,x,xRefer,y,yRefer,refer,deg + 1)) - x + y == iPlus2(#1 + #2,x,y) - x - y == iPlus2(#1 - #2,x,y) - - y == iMap2(_-#1,#1,false,y) + x + y == iPlus2((xi,yi) +-> xi + yi, x, y) + x - y == iPlus2((xi,yi) +-> xi - yi, x, y) + - y == iMap2((x,n) +-> -x, z +-> z, false, y) -- gives correct defaults for I, NNI and PI - n:I * x:% == (zero? n => 0; map(n * #1,x)) - n:NNI * x:% == (zero? n => 0; map(n * #1,x)) - n:PI * x:% == (zero? n => 0; map(n * #1,x)) + n:I * x:% == (zero? n => 0; map(z +-> n*z, x)) + n:NNI * x:% == (zero? n => 0; map(z +-> n*z, x)) + n:PI * x:% == (zero? n => 0; map(z +-> n*z, x)) productByTerm(coef,expon,x,xRefer,refer,n) == - iMap1(coef * #1,#1 + expon,true,x,xRefer,refer,n) + iMap1((y,m) +-> coef*y, z +-> z+expon, true, x, xRefer, refer, n) productLazyEval(x,xRefer,y,yRefer,nn) == explicitlyEmpty?(x) or explicitlyEmpty?(y) => void() @@ -47476,7 +47480,7 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where scMult := productByTerm(xCoef,xExpon,rst y,yRefer,scRefer,yExpon + 1) prRefer := ref(expon :: COM) pr := iTimes(rst x,xRefer,y,yRefer,prRefer,expon + 1) - sm := iPlus1(#1 + #2,scMult,scRefer,pr,prRefer,refer,expon + 1) + sm := iPlus1((a,b) +-> a+b,scMult,scRefer,pr,prRefer,refer,expon + 1) zero?(coef := xCoef * yCoef) => sm concat(makeTerm(expon,coef),sm) explicitEntries? x => @@ -47529,7 +47533,7 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where prodRefer := ref(nx :: COM) prod := productByTerm(-newCoef,nx - m,rst y,yRefer,prodRefer,1) sumRefer := ref(nx :: COM) - sum := iPlus1(#1 + #2,rst x,xRefer,prod,prodRefer,sumRefer,nx + 1) + sum := iPlus1((a,b)+->a+b,rst x,xRefer,prod,prodRefer,sumRefer,nx + 1) setelt(refer,(nx - m) :: COM); term := makeTerm(nx - m,newCoef) concat(term,iDivide(sum,sumRefer,y,yRefer,rym,m,refer,nx - m + 1)) -- can't have elt(xRefer) = infty unless all terms have been computed @@ -47562,7 +47566,7 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where explicitEntries? x => return "failed" lazyEvaluate x -- check if ups2 is a monomial - empty? rst y => iMap2(#1 * (ry :: Coef),#1 - ny,false,ups1) + empty? rst y => iMap2((y1,m) +-> y1*(ry::Coef),z +->z-ny, false, ups1) explicitlyEmpty? x => 0 nx := explicitEntries? x => @@ -47573,7 +47577,7 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where divide(ups1,nx,ups2,ny,ry :: Coef) taylorQuoByVar ups == - iMap2(#1,#1 - 1,false,ups - monomial(coefficient(ups,0),0)) + iMap2((y,n) +-> y, z +-> z-1,false,ups - monomial(coefficient(ups,0),0)) compose0(x,xRefer,y,yRefer,yOrd,y1,yn0,n0,refer,n) == delay -- when this function is called, we are computing the nth order @@ -47592,11 +47596,11 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where yn1 := yn0 * y1 ** ((n1 - n0) :: NNI) z := getStream yn1; zRefer := getRef yn1 degr := yOrd * n1; prodRefer := ref((degr - 1) :: COM) - prod := iMap1(xCoef * #1,#1,true,z,zRefer,prodRefer,degr) + prod := iMap1((s,k)+->xCoef*s,m+->m,true,z,zRefer,prodRefer,degr) coRefer := ref((degr + yOrd - 1) :: COM) - co := compose0(rst x,xRefer,y,yRefer,yOrd,y1,yn1,n1,coRefer,degr + yOrd) + co := compose0(rst x,xRefer,y,yRefer,yOrd,y1,yn1,n1,coRefer,degr+yOrd) setelt(refer,(degr - 1) :: COM) - iPlus1(#1 + #2,prod,prodRefer,co,coRefer,refer,degr) + iPlus1((a,b)+->a+b,prod,prodRefer,co,coRefer,refer,degr) -- can't have elt(xRefer) = infty unless all terms have been computed degr := yOrd * (retract(elt xRefer)@I + 1) setelt(refer,(degr - 1) :: COM) @@ -47620,7 +47624,7 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where if Coef has Algebra Fraction Integer then - integrate x == iMap2(1/(#2 + 1) * #1,#1 + 1,true,x) + integrate x == iMap2((y,n) +-> 1/(n+1)*y, z +-> z+1, true, x) --% Fixed point computations @@ -47654,8 +47658,8 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where fInv := iExquo(1,f,false) :: %; y := r * fp * fInv yRef := getRef y; yStr := getStream y intRef := ref((-1) :: COM); ansRef := ref(0 :: COM) - ansStr := Ys lazyInteg(1,iTimes(#1,ansRef,yStr,yRef,intRef,0),_ - intRef,ansRef) + ansStr := + Ys(s+->lazyInteg(1,iTimes(s,ansRef,yStr,yRef,intRef,0),intRef,ansRef)) makeSeries(ansRef,ansStr) iExp: (%,Coef) -> % @@ -47664,8 +47668,9 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where fp := differentiate f fpRef := getRef fp; fpStr := getStream fp intRef := ref((-1) :: COM); ansRef := ref(0 :: COM) - ansStr := Ys lazyInteg(cc,iTimes(#1,ansRef,fpStr,fpRef,intRef,0),_ - intRef,ansRef) + ansStr := + Ys(s+->lazyInteg(cc, + iTimes(s,ansRef,fpStr,fpRef,intRef,0),intRef,ansRef)) makeSeries(ansRef,ansStr) sincos0: (Coef,Coef,L ST,REF,REF,ST,REF,ST,REF) -> L ST @@ -47686,7 +47691,7 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where fpRef2 := getRef fp2; fpStr2 := getStream fp2 sinRef := ref(0 :: COM); cosRef := ref(0 :: COM) sincos := - Ys(sincos0(sinc,cosc,#1,sinRef,cosRef,fpStr,fpRef,fpStr2,fpRef2),2) + Ys(s+->sincos0(sinc,cosc,s,sinRef,cosRef,fpStr,fpRef,fpStr2,fpRef2),2) sinStr := (zero? sinc => rst first sincos; first sincos) cosStr := (zero? cosc => rst second sincos; second sincos) [makeSeries(sinRef,sinStr),makeSeries(cosRef,cosStr)] @@ -47699,8 +47704,8 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where yRef := ref((-1) :: COM) yStr : ST := -- one? sign => iPlus1(#1 + #2,oneStr,oneRef,sqStr,sqRef,yRef,0) - (sign = 1) => iPlus1(#1 + #2,oneStr,oneRef,sqStr,sqRef,yRef,0) - iPlus1(#1 - #2,oneStr,oneRef,sqStr,sqRef,yRef,0) + (sign = 1) => iPlus1((a,b)+->a+b,oneStr,oneRef,sqStr,sqRef,yRef,0) + iPlus1((a,b)+->a-b,oneStr,oneRef,sqStr,sqRef,yRef,0) intRef := ref((-1) :: COM) lazyInteg(cc,iTimes(yStr,yRef,fpStr,fpRef,intRef,0),intRef,ansRef) @@ -47709,7 +47714,7 @@ InnerSparseUnivariatePowerSeries(Coef): Exports == Implementation where -- computes the tangent (and related functions) of f. fpRef := getRef fp; fpStr := getStream fp ansRef := ref(0 :: COM) - ansStr := Ys tan0(cc,#1,ansRef,fpStr,fpRef,sign) + ansStr := Ys(s+->tan0(cc,s,ansRef,fpStr,fpRef,sign)) zero? cc => makeSeries(ansRef,rst ansStr) makeSeries(ansRef,ansStr) diff --git a/changelog b/changelog index 9d9107b..9297c74 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,5 @@ +20090512 tpd src/axiom-website/patches.html 20090512.06.tpd.patch +20090512 tpd books/bookvol10.3 ISUPS +-> conversion 20090512 tpd src/axiom-website/patches.html 20090512.05.tpd.patch 20090512 tpd books/bookvol10.4 IBACHIN +-> conversion 20090512 tpd src/axiom-website/patches.html 20090512.04.tpd.patch diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 1de6d0e..932a468 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -1262,5 +1262,7 @@ bookvol10.4 CTRIGMNP +-> conversion
bookvol10.3 IFAMON +-> conversion
20090512.05.tpd.patch bookvol10.4 IBACHIN +-> conversion
+20090512.06.tpd.patch +bookvol10.3 ISUPS +-> conversion