From 3de81baae28d84c24f7c967b4ccbe28f5d4043f5 Mon Sep 17 00:00:00 2001
From: Tim Daly <daly@axiom-developer.org>
Date: Mon, 26 Jan 2015 04:29:57 -0500
Subject: bookvol10.4 MLIFT bug 7298: coercion to SUP failure in factor

fixed by 20150126.02.wxh.patch, patch by Waldek Hebisch
=========================================================================
bug 7298: coercion to SUP failure in factor

t1:=(4*x^3+2*y^2+1)*(12*x^5-x^3*y+12)*(x+1)*(y^2+3)*(x^2-1)
factor(t1)

 >> Error detected within library code
 (1 . failed) cannot be coerce to mode (SparseUnivariatePolynomial (Integer))

reported on 25 Jan 2015 by Ralf Hemmecke
---
 books/bookvol10.4.pamphlet     |  600 ++++++++++++++++++++++++++++++++++++++-
 buglist                        |   23 +-
 changelog                      |    3 +
 patch                          |   35 +--
 src/axiom-website/patches.html |    2 +
 src/input/bugs.input.pamphlet  |  139 +++++++---
 6 files changed, 704 insertions(+), 98 deletions(-)

diff --git a/books/bookvol10.4.pamphlet b/books/bookvol10.4.pamphlet
index addd4fa..6a11468 100644
--- a/books/bookvol10.4.pamphlet
+++ b/books/bookvol10.4.pamphlet
@@ -77048,22 +77048,21 @@ MultivariateLifting(E,OV,R,P) : C == T
     -- The factors of m (multivariate) are determined, when the
     --  univariate true factors are known and some coefficient determined
       nplist:List SUP:=[map(coerce,pp)$SUPF2(R,P) for pp in plist]
-      empty? tlist =>
-        table:=tablePow(degree um,pmod,plist)
-        table case "failed" => error "Table construction failed in MLIFT"
-        lifting1(um,lvar,nplist,vlist,tlist,empty(),listdeg,table,pmod)
-      ldcoef:DetCoef:=npcoef(um,plist,tlist)
-      if not empty?(listdet:=ldcoef.deter) then
-        if #listdet = #plist  then return listdet
-        plist:=ldcoef.nfacts
-        nplist:=[map(coerce,pp)$SUPF2(R,P) for pp in plist]
-        um:=(um exquo */[pol for pol in listdet])::SUP
-        tlist:=ldcoef.nlead
-        tab:=tablePow(degree um,pmod,plist.rest)
-      else tab:=tablePow(degree um,pmod,plist)
+      listdet : L SUP := []
+      coeflist: L VTerm := []
+      if not(empty? tlist) then
+        ldcoef : DetCoef := npcoef(um, plist, tlist)
+        if not empty?(listdet := ldcoef.deter) then
+          if #listdet = #plist then return listdet
+          plist := ldcoef.nfacts
+          nplist := [map(coerce, pp)$SUPF2(R, P) for pp in plist]
+          um := (um exquo */[pol for pol in listdet])::SUP
+          tlist := ldcoef.nlead
+          coeflist := ldcoef.dterm
+      tab := tablePow(degree um, pmod, plist)
       tab case "failed" => error "Table construction failed in MLIFT"
       table:Table:=tab
-      ffl:=lifting1(um,lvar,nplist,vlist,tlist,ldcoef.dterm,listdeg,table,pmod)
+      ffl:=lifting1(um,lvar,nplist,vlist,tlist,coeflist,listdeg,tab,pmod)
       if ffl case "failed" then return "failed"
       append(listdet,ffl:: L SUP)
 
@@ -105076,10 +105075,365 @@ NagInterpolationPackage(): Exports == Implementation where
 )set message auto off
 )clear all
 
---S 1 of 1
+--S 1 of 36
 )show NagLapack
+--R 
+--R NagLapack  is a package constructor
+--R Abbreviation for NagLapack is NAGF07 
+--R This constructor is exposed in this frame.
+--R Issue )edit bookvol10.4.pamphlet to see algebra source code for NAGF07 
+--R
+--R------------------------------- Operations --------------------------------
+--R f07adf : (Integer,Integer,Integer,Matrix(DoubleFloat)) -> Result
+--R f07aef : (String,Integer,Integer,Matrix(DoubleFloat),Integer,Matrix(Integer),Integer,Matrix(DoubleFloat)) -> Result
+--R f07fdf : (String,Integer,Integer,Matrix(DoubleFloat)) -> Result
+--R f07fef : (String,Integer,Integer,Matrix(DoubleFloat),Integer,Integer,Matrix(DoubleFloat)) -> Result
+--R
 --E 1
 
+)clear all
+
+--S 2 of 36
+showArrayValues true
+--R 
+--R
+--R   (1)  true
+--R                                                                Type: Boolean
+--E 2
+
+--S 3 of 36
+showScalarValues true
+--R 
+--R
+--R   (2)  true
+--R                                                                Type: Boolean
+--E 3
+
+--S 4 of 36
+m:=4
+--R 
+--R
+--R   (3)  4
+--R                                                        Type: PositiveInteger
+--E 4
+
+--S 5 of 36
+n:=4
+--R 
+--R
+--R   (4)  4
+--R                                                        Type: PositiveInteger
+--E 5
+
+--S 6 of 36
+lda:=4
+--R 
+--R
+--R   (5)  4
+--R                                                        Type: PositiveInteger
+--E 6
+
+--S 7 of 36
+a:Matrix SF:=
+ [[1.8 ,2.88 ,2.05 ,-0.89 ],_
+  [5.25 ,-2.95 ,-0.95 ,-3.8 ],_
+  [1.58 ,-2.69 ,-2.9 ,-1.04 ],_
+  [-1.11 ,-0.66 ,-0.59 ,0.8 ]]
+--R 
+--R
+--R   (6)
+--R   [
+--R     [1.7999999999999998, 2.8799999999999999, 2.0499999999999998,
+--R      - 0.8899999999999999]
+--R     ,
+--R    [5.25,- 2.9499999999999997,- 0.94999999999999996,- 3.7999999999999998],
+--R
+--R     [1.5800000000000001, - 2.6900000000000004, - 2.9000000000000004,
+--R      - 1.0399999999999998]
+--R     ,
+--R
+--R     [- 1.1099999999999999, - 0.65999999999999992, - 0.59000000000000008,
+--R      0.80000000000000004]
+--R     ]
+--R                                                    Type: Matrix(DoubleFloat)
+--E 7
+
+--S 8 of 36
+-- result:=f07adf(m,n,lda,a)
+--E 8
+
+)clear all
+
+--S 9 of 36
+showArrayValues true
+--R 
+--R
+--R   (1)  true
+--R                                                                Type: Boolean
+--E 9
+
+--S 10 of 36
+showScalarValues true
+--R 
+--R
+--R   (2)  true
+--R                                                                Type: Boolean
+--E 10
+
+--S 11 of 36
+trans:="N"
+--R 
+--R
+--R   (3)  "N"
+--R                                                                 Type: String
+--E 11
+
+--S 12 of 36
+n:=4
+--R 
+--R
+--R   (4)  4
+--R                                                        Type: PositiveInteger
+--E 12
+
+--S 13 of 36
+nrhs:=2
+--R 
+--R
+--R   (5)  2
+--R                                                        Type: PositiveInteger
+--E 13
+
+--S 14 of 36
+a:Matrix SF:=
+ [[5.25 ,-2.95 ,-0.95 ,-3.8 ],_
+  [0.34 ,3.89 ,2.38 ,0.41 ],_
+  [0.3 ,-0.46 ,-1.51 ,0.29 ],_
+  [-0.21 ,-0.33 ,0.01 ,1.13 ]]
+--R 
+--R
+--R   (6)
+--R   [[5.25,- 2.9499999999999997,- 0.94999999999999996,- 3.7999999999999998],
+--R
+--R     [0.33999999999999997, 3.8899999999999997, 2.3799999999999999,
+--R      0.40999999999999998]
+--R     ,
+--R
+--R     [0.29999999999999999, - 0.45999999999999996, - 1.5099999999999998,
+--R      0.28999999999999998]
+--R     ,
+--R
+--R     [- 0.21000000000000002, - 0.32999999999999996, 9.9999999999999985E-3,
+--R      1.1299999999999999]
+--R     ]
+--R                                                    Type: Matrix(DoubleFloat)
+--E 14
+
+--S 15 of 36
+lda:=4
+--R 
+--R
+--R   (7)  4
+--R                                                        Type: PositiveInteger
+--E 15
+
+--S 16 of 36
+ipiv:Matrix Integer:= [[2 ,2 ,3 ,4 ]]
+--R 
+--R
+--R   (8)  [2  2  3  4]
+--R                                                        Type: Matrix(Integer)
+--E 16
+
+--S 17 of 36
+ldb:=4
+--R 
+--R
+--R   (9)  4
+--R                                                        Type: PositiveInteger
+--E 17
+
+--S 18 of 36
+b:Matrix SF:=
+  [[9.52 ,18.47 ],_
+   [24.35 ,2.25 ],_
+   [0.77 ,-13.3 ],_
+   [-6.22 ,-6.21 ]]
+--R 
+--R
+--R         + 9.5199999999999996    18.469999999999999 +
+--R         |                                          |
+--R         | 24.350000000000001           2.25        |
+--R   (10)  |                                          |
+--R         |0.77000000000000002   - 13.299999999999999|
+--R         |                                          |
+--R         +- 6.2200000000000006  - 6.2100000000000009+
+--R                                                    Type: Matrix(DoubleFloat)
+--E 18
+
+--S 19 of 36
+-- result:=f07aef(trans,n,nrhs,a,lda,ipiv,ldb,b)
+--E 19
+
+)clear all
+
+--S 20 of 36
+showArrayValues true
+--R 
+--R
+--R   (1)  true
+--R                                                                Type: Boolean
+--E 20
+
+--S 21 of 36
+showScalarValues true
+--R 
+--R
+--R   (2)  true
+--R                                                                Type: Boolean
+--E 21
+
+--S 22 of 36
+uplo:="L"
+--R 
+--R
+--R   (3)  "L"
+--R                                                                 Type: String
+--E 22
+
+--S 23 of 36
+n:=4
+--R 
+--R
+--R   (4)  4
+--R                                                        Type: PositiveInteger
+--E 23
+
+--S 24 of 36
+lda:=4
+--R 
+--R
+--R   (5)  4
+--R                                                        Type: PositiveInteger
+--E 24
+
+--S 25 of 36
+a:Matrix SF:=
+ [[4.16 ,0.0 ,0.0 ,0.0 ],_
+  [-3.12 ,5.03 ,0.0 ,0.0 ],_
+  [0.56 ,-0.83 ,0.76 ,0.0 ],_
+  [-0.1 ,1.18 ,0.34 ,1.18 ]]
+--R 
+--R
+--R   (6)
+--R   [[4.1600000000000001,0.,0.,0.],
+--R    [- 3.1199999999999997,5.0299999999999994,0.,0.],
+--R    [0.56000000000000005,- 0.83000000000000007,0.76000000000000001,0.],
+--R
+--R     [- 9.9999999999999992E-2, 1.1799999999999999, 0.33999999999999997,
+--R      1.1799999999999999]
+--R     ]
+--R                                                    Type: Matrix(DoubleFloat)
+--E 25
+
+--S 26 of 36
+-- result:=f07fdf(uplo,n,lda,a)
+--E 26
+
+)clear all
+
+--S 27 of 36
+showArrayValues true
+--R 
+--R
+--R   (1)  true
+--R                                                                Type: Boolean
+--E 27
+
+--S 28 of 36
+showScalarValues true
+--R 
+--R
+--R   (2)  true
+--R                                                                Type: Boolean
+--E 28
+
+--S 29 of 36
+uplo:="L"
+--R 
+--R
+--R   (3)  "L"
+--R                                                                 Type: String
+--E 29
+
+--S 30 of 36
+n:=4
+--R 
+--R
+--R   (4)  4
+--R                                                        Type: PositiveInteger
+--E 30
+
+--S 31 of 36
+nrhs:=2
+--R 
+--R
+--R   (5)  2
+--R                                                        Type: PositiveInteger
+--E 31
+
+--S 32 of 36
+a:Matrix SF:=
+ [[2.04 ,0.0 ,0.0 ,0.0 ],_
+  [-1.53 ,1.64 ,0.0 ,0.0 ],_
+  [0.28 ,-0.25 ,0.79 ,0.0 ],_
+  [-0.05 ,0.67 ,0.66 ,0.54 ]]
+--R 
+--R
+--R   (6)
+--R   [[2.04,0.,0.,0.], [- 1.5299999999999998,1.6399999999999999,0.,0.],
+--R    [0.28000000000000003,- 0.25,0.79000000000000004,0.],
+--R
+--R     [- 4.9999999999999996E-2, 0.66999999999999993, 0.65999999999999992,
+--R      0.54000000000000004]
+--R     ]
+--R                                                    Type: Matrix(DoubleFloat)
+--E 32
+
+--S 33 of 36
+lda:=4
+--R 
+--R
+--R   (7)  4
+--R                                                        Type: PositiveInteger
+--E 33
+
+--S 34 of 36
+ldb:=4
+--R 
+--R
+--R   (8)  4
+--R                                                        Type: PositiveInteger
+--E 34
+
+--S 35 of 36
+b:Matrix SF:= [[8.7 ,8.3 ],[-13.35 ,2.13 ],[1.89 ,1.61 ],[-4.14 ,5 ]]
+--R 
+--R
+--R        + 8.6999999999999993   8.3000000000000007+
+--R        |                                        |
+--R        |- 13.350000000000001  2.1299999999999999|
+--R   (9)  |                                        |
+--R        | 1.8899999999999999   1.6099999999999999|
+--R        |                                        |
+--R        +- 4.1400000000000006          5.        +
+--R                                                    Type: Matrix(DoubleFloat)
+--E 35
+
+--S 36 of 36
+-- result:=f07fef(uplo,n,nrhs,a,lda,ldb,b)
+--E 36
+
 )spool
 )lisp (bye)
 \end{chunk}
@@ -132594,11 +132948,225 @@ NagSeriesSummationPackage(): Exports == Implementation where
 )set message auto off
 )clear all
 
---S 1 of 1
+--S 1 of 41
 )show NagSpecialFunctionsPackage
---E 1
+--R 
+--R NagSpecialFunctionsPackage  is a package constructor
+--R Abbreviation for NagSpecialFunctionsPackage is NAGS 
+--R This constructor is exposed in this frame.
+--R Issue )edit bookvol10.4.pamphlet to see algebra source code for NAGS 
+--R
+--R------------------------------- Operations --------------------------------
+--R s01eaf : (Complex(DoubleFloat),Integer) -> Result
+--R s13aaf : (DoubleFloat,Integer) -> Result
+--R s13acf : (DoubleFloat,Integer) -> Result
+--R s13adf : (DoubleFloat,Integer) -> Result
+--R s14aaf : (DoubleFloat,Integer) -> Result
+--R s14abf : (DoubleFloat,Integer) -> Result
+--R s14baf : (DoubleFloat,DoubleFloat,DoubleFloat,Integer) -> Result
+--R s15adf : (DoubleFloat,Integer) -> Result
+--R s15aef : (DoubleFloat,Integer) -> Result
+--R s17acf : (DoubleFloat,Integer) -> Result
+--R s17adf : (DoubleFloat,Integer) -> Result
+--R s17aef : (DoubleFloat,Integer) -> Result
+--R s17aff : (DoubleFloat,Integer) -> Result
+--R s17agf : (DoubleFloat,Integer) -> Result
+--R s17ahf : (DoubleFloat,Integer) -> Result
+--R s17ajf : (DoubleFloat,Integer) -> Result
+--R s17akf : (DoubleFloat,Integer) -> Result
+--R s17dcf : (DoubleFloat,Complex(DoubleFloat),Integer,String,Integer) -> Result
+--R s17def : (DoubleFloat,Complex(DoubleFloat),Integer,String,Integer) -> Result
+--R s17dgf : (String,Complex(DoubleFloat),String,Integer) -> Result
+--R s17dhf : (String,Complex(DoubleFloat),String,Integer) -> Result
+--R s17dlf : (Integer,DoubleFloat,Complex(DoubleFloat),Integer,String,Integer) -> Result
+--R s18acf : (DoubleFloat,Integer) -> Result
+--R s18adf : (DoubleFloat,Integer) -> Result
+--R s18aef : (DoubleFloat,Integer) -> Result
+--R s18aff : (DoubleFloat,Integer) -> Result
+--R s18dcf : (DoubleFloat,Complex(DoubleFloat),Integer,String,Integer) -> Result
+--R s18def : (DoubleFloat,Complex(DoubleFloat),Integer,String,Integer) -> Result
+--R s19aaf : (DoubleFloat,Integer) -> Result
+--R s19abf : (DoubleFloat,Integer) -> Result
+--R s19acf : (DoubleFloat,Integer) -> Result
+--R s19adf : (DoubleFloat,Integer) -> Result
+--R s20acf : (DoubleFloat,Integer) -> Result
+--R s20adf : (DoubleFloat,Integer) -> Result
+--R s21baf : (DoubleFloat,DoubleFloat,Integer) -> Result
+--R s21bbf : (DoubleFloat,DoubleFloat,DoubleFloat,Integer) -> Result
+--R s21bcf : (DoubleFloat,DoubleFloat,DoubleFloat,Integer) -> Result
+--R s21bdf : (DoubleFloat,DoubleFloat,DoubleFloat,DoubleFloat,Integer) -> Result
+--E 1
+
+--S 2 of 41
+showArrayValues true
+--R 
+--R
+--R   (1)  true
+--R                                                                Type: Boolean
+--E 2
+
+--S 3 of 41
+showScalarValues true
+--R 
+--R
+--R   (2)  true
+--R                                                                Type: Boolean
+--E 3
+
+--S 4 of 41
+-- result:=s01eaf(complex(-0.5,2.0),-1)
+--E 4
+
+--S 5 of 41
+-- result:=s13aaf(2.0,-1)
+--E 5
+
+--S 6 of 41
+-- result:=s13acf(0.2,-1)
+--E 6
+
+--S 7 of 41
+-- result:=s13adf(0.2,-1)
+--E 7
+
+--S 8 of 41
+-- result:=s14aaf(1.25,-1)
+--E 8
+
+--S 9 of 41
+-- result:=s14abf(1.25,-1)
+--E 9
+
+--S 10 of 41
+-- result:=s14baf(2.0,3.0,1.1102230246251600E-16,-1)
+--E 10
+
+--S 11 of 41
+-- result:=s15adf(-10.0,-1)
+--E 11
+
+--S 12 of 41
+-- result:=s15aef(-6.0,-1)
+--E 12
+
+--S 13 of 41
+-- result:=s17acf(0.5,-1)
+--E 13
+
+--S 14 of 41
+-- result:=s17adf(0.5,-1)
+--E 14
+
+--S 15 of 41
+-- result:=s17aef(0.5,-1)
+--E 15
+
+--S 16 of 41
+-- result:=s17aff(0.5,-1)
+--E 16
+
+--S 17 of 41
+-- result:=s17agf(-10.0,-1)
+--E 17
+
+--S 18 of 41
+-- result:=s17ahf(-10.0,-1)
+--E 18
+
+--S 19 of 41
+-- result:=s17ajf(-10.0,-1)
+--E 19
+
+--S 20 of 41
+-- result:=s17akf(-10.0,-1)
+--E 20
+
+--S 21 of 41
+-- result:=s17dcf(0.0,complex(0.3,0.4),2,"u", -1)
+--E 21
+
+--S 22 of 41
+-- result:=s17def(0.0,complex(0.3,0.4),2,"u", -1)
+--E 22
+
+--S 23 of 41
+-- result:=s17dgf("f",complex(0.3,0.4),"u", -1)
+--E 23
+
+--S 24 of 41
+-- result:=s17dhf("f",complex(0.3,0.4),"u", -1)
+--E 24
+
+--S 25 of 41
+-- result:=s17dlf(1, 0.0,complex(0.3,0.4),2,"u", -1)
+--E 25
+
+--S 26 of 41
+-- result:=s18acf(0.4,-1)
+--E 26
+
+--S 27 of 41
+-- result:=s18adf(0.4,-1)
+--E 27
+
+--S 28 of 41
+-- result:=s18aef(0.5,-1)
+--E 28
+
+--S 29 of 41
+-- result:=s18aff(0.5,-1)
+--E 29
+
+--S 30 of 41
+-- result:=s18dcf(0.0,complex(0.3,0.4),2,"u", -1)
+--E 30
+
+--S 31 of 41
+-- result:=s18def(0.0,complex(0.3,-0.4),2,"u", -1)
+--E 31
+
+--S 32 of 41
+-- result:=s19aaf(1.0,-1)
+--E 32
+
+--S 33 of 41
+-- result:=s19abf(0.1,-1)
+--E 33
+
+--S 34 of 41
+-- result:=s19acf(0.1,-1)
+--E 34
+
+--S 35 of 41
+-- result:=s19adf(0.0,-1)
+--E 35
+
+--S 36 of 41
+-- result:=s20acf(0.5,-1)
+--E 36
+
+--S 37 of 41
+-- result:=s20adf(0.5,-1)
+--E 37
+
+--S 38 of 41
+-- result:=s21baf(0.5,1.0,-1)
+--E 38
+
+--S 39 of 41
+-- result:=s21bbf(0.5,1.0,1.5,-1)
+--E 39
+
+--S 40 of 41
+-- result:=s21bcf(0.5,0.5,1.0,-1)
+--E 40
+
+--S 41 of 41
+-- result:=s21bdf(0.5,0.5,0.5,2.0,-1)
+--E 41
 
 )spool
+
 )lisp (bye)
 \end{chunk}
 
diff --git a/buglist b/buglist
index 3bb5842..d3da3e8 100644
--- a/buglist
+++ b/buglist
@@ -12,17 +12,6 @@ dup 50006:
 nonextend 60077:
 
 =========================================================================
-bug 7298: coercion to SUP failure in factor
-
-t1:=(4*x^3+2*y^2+1)*(12*x^5-x^3*y+12)*(x+1)*(y^2+3)*(x^2-1)
-factor(t1)
-
- >> Error detected within library code
- (1 . failed) cannot be coerce to mode (SparseUnivariatePolynomial (Integer))
-
-reported on 25 Jan 2015 by Ralf Hemmecke
-
-=========================================================================
 bug 7296: connect from VIEW2D is not graph specific
 
 The connect function in VIEW2D globally turns lines on or off.
@@ -41711,3 +41700,15 @@ output for a number with radix greater than 10.
 
 reported on 25 Jan 2015 by Frederick H. Pitts <fred.pitts@comcast.net>
 
+fixed by 20150126.02.wxh.patch, patch by Waldek Hebisch
+=========================================================================
+bug 7298: coercion to SUP failure in factor
+
+t1:=(4*x^3+2*y^2+1)*(12*x^5-x^3*y+12)*(x+1)*(y^2+3)*(x^2-1)
+factor(t1)
+
+ >> Error detected within library code
+ (1 . failed) cannot be coerce to mode (SparseUnivariatePolynomial (Integer))
+
+reported on 25 Jan 2015 by Ralf Hemmecke
+
diff --git a/changelog b/changelog
index de4a9f8..9b8df2c 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,6 @@
+20150125 wxh src/axiom-website/patches.html 20150126.02.wxh.patch
+20150125 wxh bookvol10.4 MLIFT bug 7298: coercion to SUP failure in factor
+20150125 wxh src/input/bugs.input add regresstion test for bug 7298
 20150125 fmp src/axiom-website/patches.html 20150126.01.fmp.patch
 20150126 fmp books/bookvol10.3 fixed bug 7297: Extraneous "#\" characters
 20150126 fmp src/input/radixtex.input regression test fixed bug 7297
diff --git a/patch b/patch
index b40619f..0d4432f 100644
--- a/patch
+++ b/patch
@@ -1,32 +1,13 @@
-books/bookvol10.3 fixed bug 7297: Extraneous "#\" characters
+bookvol10.4 MLIFT bug 7298: coercion to SUP failure in factor
 
-fixed by 20150126.01.fmp.patch (sent by Frederick H. Pitts)
+fixed by 20150126.02.wxh.patch, patch by Waldek Hebisch
 =========================================================================
-bug 7297: Extraneous "#\" characters in Axiom TeX output
-
-    The Axiom TeX output for a number with radix greater than 10
-potentially contains "#\A" (A is any upper case alphabetic character)
-where it should contain just "A" (the double quotes are mine, they do
-not appear in the actual output).  This particular bug is used as a
-Axiom debugging example in "Volume 4: Axiom Developers Guide' on page
-91, but no fix is presented there.  In the release notes I stumbled over
-a fix to essentially the same bug in HTML output.  A quick fix applied
-to the TeX case is to replace the invocation of the Lisp function
-"object2String" with "mathObject2String" (again, the double quotes are
-mine) in the file bookvol10.3.pamphlet, line 132043.
-
-    I came across this issue while trying to use TeXmacs as a front end
-to Axiom.  In that environment, the above fix generates nicely formatted
-numbers with fixed width characters (i.e. monospaced) and over-lining as
-needed.  On the other hand, if I run Axiom in an Emacs shell and attempt
-to use latex-math-preview-expression to format the Axiom TeX output, the
-number is not so nicely formatted.  The letter digits are slanted and
-variable width while the number digits are upright and fixed width.
-Maybe a "\rm" font specification command is needed in the Axiom TeX
-output for a number with radix greater than 10.
-
-reported on 25 Jan 2015 by Frederick H. Pitts <fred.pitts@comcast.net>
-
+bug 7298: coercion to SUP failure in factor
 
+t1:=(4*x^3+2*y^2+1)*(12*x^5-x^3*y+12)*(x+1)*(y^2+3)*(x^2-1)
+factor(t1)
 
+ >> Error detected within library code
+ (1 . failed) cannot be coerce to mode (SparseUnivariatePolynomial (Integer))
 
+reported on 25 Jan 2015 by Ralf Hemmecke
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 1fd86b9..4ffcf33 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -4976,6 +4976,8 @@ buglist: bug 7297: Extraneous "#\" characters in Axiom TeX output<br/>
 buglist: bug 7298: coercion to SUP failure in factor<br/>
 <a href="patches/20150126.01.fmp.patch">20150126.01.fmp.patch</a>
 books/bookvol10.3 fixed bug 7297: Extraneous "#\" characters<br/>
+<a href="patches/20150126.02.wxh.patch">20150126.02.wxh.patch</a>
+bookvol10.4 MLIFT bug 7298: coercion to SUP failure in factor<br/>
  </body>
 </html>
 
diff --git a/src/input/bugs.input.pamphlet b/src/input/bugs.input.pamphlet
index 4b72cab..ed7be36 100644
--- a/src/input/bugs.input.pamphlet
+++ b/src/input/bugs.input.pamphlet
@@ -28,7 +28,7 @@
 
 )clear all
 
---S 1 of 44 
+--S 1 of 47 
 eq1:= A*x^2 + B*x*y + C*y^2 +D*x + E*y + F
 --R 
 --R
@@ -37,7 +37,7 @@ eq1:= A*x^2 + B*x*y + C*y^2 +D*x + E*y + F
 --R                                                    Type: Polynomial(Integer)
 --E 1
 
---S 2 of 44 
+--S 2 of 47 
 eq2:= eval(eq1,[x= xdot*cos(t) - ydot*sin(t), y=xdot*sin(t) + ydot*cos(t)])
 --R 
 --R
@@ -57,7 +57,7 @@ eq2:= eval(eq1,[x= xdot*cos(t) - ydot*sin(t), y=xdot*sin(t) + ydot*cos(t)])
 
 )clear all
 
---S 3 of 44 
+--S 3 of 47 
 taylor exp x
 --R 
 --R
@@ -72,7 +72,7 @@ taylor exp x
 --R                        Type: UnivariateTaylorSeries(Expression(Integer),x,0)
 --E 3
 
---S 4 of 44 
+--S 4 of 47 
 s := %
 --R 
 --R
@@ -87,7 +87,7 @@ s := %
 --R                        Type: UnivariateTaylorSeries(Expression(Integer),x,0)
 --E 4
 
---S 5 of 44 
+--S 5 of 47 
 s::(UTS(EXPR FLOAT, x, 0))
 --R 
 --R
@@ -109,7 +109,7 @@ s::(UTS(EXPR FLOAT, x, 0))
 --R                        Type: UnivariateTaylorSeries(Expression(Float),x,0.0)
 --E 5
 
---S 6 of 44 
+--S 6 of 47 
 s::(UTS(FLOAT, x, 0))
 --R 
 --R
@@ -131,7 +131,7 @@ s::(UTS(FLOAT, x, 0))
 --R                                    Type: UnivariateTaylorSeries(Float,x,0.0)
 --E 6
 
---S 7 of 44 
+--S 7 of 47 
 eval(s,1)
 --R 
 --R
@@ -141,7 +141,7 @@ eval(s,1)
 --R                                            Type: Stream(Expression(Integer))
 --E 7
 
---S 8 of 44 
+--S 8 of 47 
 %::(Stream Float)
 --R 
 --R
@@ -157,19 +157,19 @@ eval(s,1)
 
 )clear all
 
---S 9 of 44 
+--S 9 of 47 
 f(x) == x+1
 --R 
 --R                                                                   Type: Void
 --E 9
 
---S 10 of 44 
+--S 10 of 47 
 f(x,y) == x+y
 --R 
 --R                                                                   Type: Void
 --E 10
 
---S 11 of 44 
+--S 11 of 47 
 f 3
 --R 
 --R   Compiling function f with type PositiveInteger -> PositiveInteger 
@@ -178,7 +178,7 @@ f 3
 --R                                                        Type: PositiveInteger
 --E 11
 
---S 12 of 44 
+--S 12 of 47 
 f(3,4)
 --R 
 --R   Compiling function f with type (PositiveInteger,PositiveInteger) -> 
@@ -188,7 +188,7 @@ f(3,4)
 --R                                                        Type: PositiveInteger
 --E 12
 
---S 13 of 44 
+--S 13 of 47 
 f(5)
 --R 
 --R
@@ -196,7 +196,7 @@ f(5)
 --R                                                        Type: PositiveInteger
 --E 13
 
---S 14 of 44 
+--S 14 of 47 
 f(1,x)
 --R 
 --R   Compiling function f with type (PositiveInteger,Variable(x)) -> 
@@ -211,7 +211,7 @@ f(1,x)
 
 )clear all
 
---S 15 of 44 
+--S 15 of 47 
 series(n +-> bernoulli(n)/factorial(n), t=0)
 --R 
 --R
@@ -227,7 +227,7 @@ series(n +-> bernoulli(n)/factorial(n), t=0)
 
 )clear all
 
---S 16 of 44 
+--S 16 of 47 
 l := [1,2,-1]
 --R 
 --R
@@ -235,19 +235,19 @@ l := [1,2,-1]
 --R                                                          Type: List(Integer)
 --E 16
 
---S 17 of 44 
+--S 17 of 47 
 f : INT -> FRAC INT
 --R 
 --R                                                                   Type: Void
 --E 17
 
---S 18 of 44 
+--S 18 of 47 
 f x == x
 --R 
 --R                                                                   Type: Void
 --E 18
 
---S 19 of 44 
+--S 19 of 47 
 map(f, l)
 --R 
 --R   Compiling function f with type Integer -> Fraction(Integer) 
@@ -261,25 +261,25 @@ map(f, l)
 
 )clear all
  
---S 20 of 44 
+--S 20 of 47 
 f: INT -> INT
 --R 
 --R                                                                   Type: Void
 --E 20
 
---S 21 of 44 
+--S 21 of 47 
 f x == x+1
 --R 
 --R                                                                   Type: Void
 --E 21
 
---S 22 of 44 
+--S 22 of 47 
 u g == g 3
 --R 
 --R                                                                   Type: Void
 --E 22
 
---S 23 of 44 
+--S 23 of 47 
 u f
 --R 
 --R   Compiling function u with type (Integer -> Integer) -> Integer 
@@ -294,7 +294,7 @@ u f
 
 )clear all
 
---S 24 of 44 
+--S 24 of 47 
 groebner [x^2 - y, y^3+1]
 --R 
 --R
@@ -308,7 +308,7 @@ groebner [x^2 - y, y^3+1]
 
 )clear all
 
---S 25 of 44 
+--S 25 of 47 
 factor x
 --R 
 --R
@@ -321,7 +321,7 @@ factor x
 
 )clear all
  
---S 26 of 44 
+--S 26 of 47 
 {}$(List INT)
 --R 
 --R 
@@ -329,7 +329,7 @@ factor x
 --R   The function SEQ is not implemented in List(Integer) .
 --E 26
 
---S 27 of 44 
+--S 27 of 47 
 {1}
 --R 
 --R
@@ -342,7 +342,7 @@ factor x
 
 )clear all
  
---S 28 of 44 
+--S 28 of 47 
 map(variable, [x,y])
 --R 
 --R
@@ -356,19 +356,19 @@ map(variable, [x,y])
  
 )clear all
  
---S 29 of 44 
+--S 29 of 47 
 p(n,x) == if n=0 then 1 else (x+n-1)*p(n-1,x)
 --R 
 --R                                                                   Type: Void
 --E 29
 
---S 30 of 44 
+--S 30 of 47 
 pp(n,x) == if n=0 then 1 else if n<0 then (-1)^n/p(-n,1-x) else p(n,x)
 --R 
 --R                                                                   Type: Void
 --E 30
 
---S 31 of 44 
+--S 31 of 47 
 pp(-1,x) -- should be 1/(x-1)
 --R 
 --R   Compiling function p with type (Integer,Polynomial(Integer)) -> 
@@ -388,7 +388,7 @@ pp(-1,x) -- should be 1/(x-1)
 
 )clear all
 
---S 32 of 44 
+--S 32 of 47 
 f n ==
   for i in 1..n repeat
     j:=2*i
@@ -398,7 +398,7 @@ f n ==
 --R                                                                   Type: Void
 --E 32
 
---S 33 of 44 
+--S 33 of 47 
 g n ==
     j:=2*n
     m:SQMATRIX(j,?):=1
@@ -407,7 +407,7 @@ g n ==
 --R                                                                   Type: Void
 --E 33
 
---S 34 of 44 
+--S 34 of 47 
 g 3 -- Should work
 --R 
 --R   Cannot compile the declaration for m because its (possible partial) 
@@ -427,7 +427,7 @@ g 3 -- Should work
 --R                                                                   Type: Void
 --E 34
 
---S 35 of 44 
+--S 35 of 47 
 f 3 -- Bombs
 --R 
 --R   Cannot compile the declaration for m because its (possible partial) 
@@ -461,7 +461,7 @@ f 3 -- Bombs
 
 )clear all
  
---S 36 of 44 
+--S 36 of 47 
 mp(x,l) ==
   l is [a,:b] =>
     a*x^(#b)+ mp(x,b)
@@ -470,7 +470,7 @@ mp(x,l) ==
 --R                                                                   Type: Void
 --E 36
 
---S 37 of 44 
+--S 37 of 47 
 mp(x, [1,3,4, 2])
 --R 
 --R   Compiling function mp with type (Variable(x),List(PositiveInteger))
@@ -481,7 +481,7 @@ mp(x, [1,3,4, 2])
 --R                                                    Type: Polynomial(Integer)
 --E 37
 
---S 38 of 44 
+--S 38 of 47 
 mp(x, [1,2,-3, 4])
 --R 
 --R   Compiling function mp with type (Variable(x),List(Integer)) -> 
@@ -496,14 +496,14 @@ mp(x, [1,2,-3, 4])
 
 )clear all
  
---S 39 of 44 
+--S 39 of 47 
 f1 n ==
   if n=0 then 1 else if n=1 then 1 else f1(n-1)+f1(n-2)
 --R 
 --R                                                                   Type: Void
 --E 39
 
---S 40 of 44 
+--S 40 of 47 
 f2 n ==
   m:=n
   if n=0 then 1 else if n=1 then 1 else f2(n-1)+f2(n-2)
@@ -511,7 +511,7 @@ f2 n ==
 --R                                                                   Type: Void
 --E 40
 
---S 41 of 44 
+--S 41 of 47 
 f3 n ==
   n=0 => 1
   n=1 => 1
@@ -520,7 +520,7 @@ f3 n ==
 --R                                                                   Type: Void
 --E 41
 
---S 42 of 44 
+--S 42 of 47 
 f4 n ==
   m:=n
   n=0 => 1
@@ -531,13 +531,13 @@ f4 n ==
 --R                                                                   Type: Void
 --E 42
 
---S 43 of 44 
+--S 43 of 47 
 f5 n == if n=0 or n=1 then 1 else f5(n-1)+f5(n-2)
 --R 
 --R                                                                   Type: Void
 --E 43
 
---S 44 of 44 
+--S 44 of 47 
 [f1 3,f2 3, f3 3,f4 3,f5 3]
 --R 
 --R   Compiling function f1 with type Integer -> PositiveInteger 
@@ -549,6 +549,57 @@ f5 n == if n=0 or n=1 then 1 else f5(n-1)+f5(n-2)
 --R   (6)  [3,3,3,3,3]
 --R                                                  Type: List(PositiveInteger)
 --E 44
+
+-- regression test of bug 7298: coercion to SUP failure in factor
+-- fixed by 20150126.02.wxh.patch
+
+--S 45 of 47
+rh1:=(4*x^3+2*y^2+1)*(12*x^5-x^3*y+12)*(x+1)*(y^2+3)*(x^2-1)
+--R 
+--R
+--R   (7)
+--R          6     5     4     3  5
+--R     (- 2x  - 2x  + 2x  + 2x )y
+--R   + 
+--R         8      7      6      5      3      2             4
+--R     (24x  + 24x  - 24x  - 24x  + 24x  + 24x  - 24x - 24)y
+--R   + 
+--R          9     8     7     6     5     4     3  3
+--R     (- 4x  - 4x  + 4x  - 3x  - 7x  + 7x  + 7x )y
+--R   + 
+--R            11      10      9      8      7      6      5      4      3      2
+--R         48x   + 48x   - 48x  + 36x  + 84x  - 36x  - 36x  - 48x  + 36x  + 84x
+--R       + 
+--R         - 84x - 84
+--R    *
+--R        2
+--R       y
+--R   + 
+--R           9      8      7     6     5     4     3         11       10       9
+--R     (- 12x  - 12x  + 12x  + 9x  - 3x  + 3x  + 3x )y + 144x   + 144x   - 144x
+--R   + 
+--R           8      7       6       5       4       3      2
+--R     - 108x  + 36x  + 108x  + 108x  - 144x  - 108x  + 36x  - 36x - 36
+--R                                                    Type: Polynomial(Integer)
+--E 45
+
+--S 46 of 47
+rh2:=factor(rh1)
+--R 
+--R
+--R                        2  3       5        2        2     3
+--R   (8)  - (x - 1)(x + 1) (x y - 12x  - 12)(y  + 3)(2y  + 4x  + 1)
+--R                                          Type: Factored(Polynomial(Integer))
+--E 46
+
+--S 47 of 47
+rh2-rh1
+--R 
+--R
+--R   (9)  0
+--R                                          Type: Factored(Polynomial(Integer))
+--E 47
+
 )spool
 )lisp (bye)
  
-- 
1.7.5.4

