From: SourceForge.net <noreply@so...>  20070402 04:03:58

Bugs item #1692651, was opened at 20070401 22:03 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: None Status: Open Resolution: None Priority: 7 Private: No Submitted By: Robert Dodier (robert_dodier) Assigned to: Nobody/Anonymous (nobody) Summary: MGRP gets sense of comparison backwards Initial Comment: The function MGRP (greaterthan comparison) can get the sense of the comparison backwards. MGRP is called indirectly from MEVALP and maybe other places as well. e.g. ?mgrp (x, 1); => x  1 > 0 (OK) ?mgrp (1, x); => x  1 > 0 (OOPS) I'm pretty sure the cause of this is the use of special variables in src/compar.lisp. I think what's happening is that SIGN1 calls itself, clobbering some of the specials. I believe the right way to fix this is to rework the comparison code to use only lexical variables instead of specials. For the record: (%i1) :lisp (trace sign1) (SIGN1) (%i1) ?mgrp (x, 1); 1> (SIGN1 ((MPLUS SIMP) 1 $X)) <1 (SIGN1 $PNZ) (%o1) x  1 > 0 (%i2) ?mgrp (1, x); 1> (SIGN1 ((MPLUS SIMP) 1 ((MTIMES SIMP) 1 $X))) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 $X) <2 (SIGN1 $PNZ) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 ((MPLUS SIMP IRREDUCIBLE) 1 $X)) <2 (SIGN1 $PNZ) <1 (SIGN1 $PNZ) (%o2) x  1 > 0  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 
From: SourceForge.net <noreply@so...>  20070405 11:16:53

Bugs item #1692651, was opened at 20070401 23:03 Message generated for change (Comment added) made by willisbl You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: None Status: Open Resolution: None Priority: 7 Private: No Submitted By: Robert Dodier (robert_dodier) Assigned to: Nobody/Anonymous (nobody) Summary: MGRP gets sense of comparison backwards Initial Comment: The function MGRP (greaterthan comparison) can get the sense of the comparison backwards. MGRP is called indirectly from MEVALP and maybe other places as well. e.g. ?mgrp (x, 1); => x  1 > 0 (OK) ?mgrp (1, x); => x  1 > 0 (OOPS) I'm pretty sure the cause of this is the use of special variables in src/compar.lisp. I think what's happening is that SIGN1 calls itself, clobbering some of the specials. I believe the right way to fix this is to rework the comparison code to use only lexical variables instead of specials. For the record: (%i1) :lisp (trace sign1) (SIGN1) (%i1) ?mgrp (x, 1); 1> (SIGN1 ((MPLUS SIMP) 1 $X)) <1 (SIGN1 $PNZ) (%o1) x  1 > 0 (%i2) ?mgrp (1, x); 1> (SIGN1 ((MPLUS SIMP) 1 ((MTIMES SIMP) 1 $X))) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 $X) <2 (SIGN1 $PNZ) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 ((MPLUS SIMP IRREDUCIBLE) 1 $X)) <2 (SIGN1 $PNZ) <1 (SIGN1 $PNZ) (%o2) x  1 > 0  >Comment By: Barton Willis (willisbl) Date: 20070405 06:16 Message: Logged In: YES user_id=895922 Originator: NO An attempt at a fix: (defun mgrp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((eq sgn '$pos) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((memq sgn '($neg $zero $nz)) nil) (t `((mgreaterp) ,a 0))))) (defun mgqp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((memq sgn '($pos $zero $pz)) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((eq sgn '$neg) nil) (t `((mgeqp) ,a 0))))) Notes: (1) With these functions, the test suite gives an error break on rtest15; rtest16 #39 reports a problem about the sign of infinity; and rtestsum #5 reports that the result is correct, but that Maxima expected the result to be wrong. (2) The functions c$pos and friends may have some logic in them that I've overlooked. (3) The subtraction in my functions can be a problem for inf, minf, und, and ... (4) It's possible that my functions don't properly set the values of the 'evens', 'odds', and 'sign'. This scheme confuses me. I would like to expunge the functions c$pos and friends along with 'evens', 'odds', and 'sign'.  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 
From: SourceForge.net <noreply@so...>  20070405 21:36:03

Bugs item #1692651, was opened at 20070401 23:03 Message generated for change (Comment added) made by willisbl You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: None Status: Open Resolution: None Priority: 7 Private: No Submitted By: Robert Dodier (robert_dodier) Assigned to: Nobody/Anonymous (nobody) Summary: MGRP gets sense of comparison backwards Initial Comment: The function MGRP (greaterthan comparison) can get the sense of the comparison backwards. MGRP is called indirectly from MEVALP and maybe other places as well. e.g. ?mgrp (x, 1); => x  1 > 0 (OK) ?mgrp (1, x); => x  1 > 0 (OOPS) I'm pretty sure the cause of this is the use of special variables in src/compar.lisp. I think what's happening is that SIGN1 calls itself, clobbering some of the specials. I believe the right way to fix this is to rework the comparison code to use only lexical variables instead of specials. For the record: (%i1) :lisp (trace sign1) (SIGN1) (%i1) ?mgrp (x, 1); 1> (SIGN1 ((MPLUS SIMP) 1 $X)) <1 (SIGN1 $PNZ) (%o1) x  1 > 0 (%i2) ?mgrp (1, x); 1> (SIGN1 ((MPLUS SIMP) 1 ((MTIMES SIMP) 1 $X))) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 $X) <2 (SIGN1 $PNZ) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 ((MPLUS SIMP IRREDUCIBLE) 1 $X)) <2 (SIGN1 $PNZ) <1 (SIGN1 $PNZ) (%o2) x  1 > 0  >Comment By: Barton Willis (willisbl) Date: 20070405 16:35 Message: Logged In: YES user_id=895922 Originator: NO I see that memq is no longer in Maxima. Replacing memq with a call to member, and appending an infsimp (may or may not be a good idea, I don't know), I built Maxima CVS using XP and sbcl 1.02. I passes the test suite. The code: (defun mgrp (a b) (setq a (infsimp (sub a b))) (let ((sgn (csign a))) (cond ((eq sgn '$pos) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((member sgn '($neg $zero $nz) :test #'eq) nil) (t `((mgreaterp) ,a 0))))) (defun mgqp (a b) (setq a (infsimp (sub a b))) (let ((sgn (csign a))) (cond ((member sgn '($pos $zero $pz) :test #'eq) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((eq sgn '$neg) nil) (t `((mgeqp) ,a 0)))))  Comment By: Barton Willis (willisbl) Date: 20070405 06:16 Message: Logged In: YES user_id=895922 Originator: NO An attempt at a fix: (defun mgrp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((eq sgn '$pos) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((memq sgn '($neg $zero $nz)) nil) (t `((mgreaterp) ,a 0))))) (defun mgqp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((memq sgn '($pos $zero $pz)) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((eq sgn '$neg) nil) (t `((mgeqp) ,a 0))))) Notes: (1) With these functions, the test suite gives an error break on rtest15; rtest16 #39 reports a problem about the sign of infinity; and rtestsum #5 reports that the result is correct, but that Maxima expected the result to be wrong. (2) The functions c$pos and friends may have some logic in them that I've overlooked. (3) The subtraction in my functions can be a problem for inf, minf, und, and ... (4) It's possible that my functions don't properly set the values of the 'evens', 'odds', and 'sign'. This scheme confuses me. I would like to expunge the functions c$pos and friends along with 'evens', 'odds', and 'sign'.  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 
From: SourceForge.net <noreply@so...>  20070407 17:40:19

Bugs item #1692651, was opened at 20070401 22:03 Message generated for change (Comment added) made by robert_dodier You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: None Status: Open Resolution: None Priority: 7 Private: No Submitted By: Robert Dodier (robert_dodier) >Assigned to: Barton Willis (willisbl) Summary: MGRP gets sense of comparison backwards Initial Comment: The function MGRP (greaterthan comparison) can get the sense of the comparison backwards. MGRP is called indirectly from MEVALP and maybe other places as well. e.g. ?mgrp (x, 1); => x  1 > 0 (OK) ?mgrp (1, x); => x  1 > 0 (OOPS) I'm pretty sure the cause of this is the use of special variables in src/compar.lisp. I think what's happening is that SIGN1 calls itself, clobbering some of the specials. I believe the right way to fix this is to rework the comparison code to use only lexical variables instead of specials. For the record: (%i1) :lisp (trace sign1) (SIGN1) (%i1) ?mgrp (x, 1); 1> (SIGN1 ((MPLUS SIMP) 1 $X)) <1 (SIGN1 $PNZ) (%o1) x  1 > 0 (%i2) ?mgrp (1, x); 1> (SIGN1 ((MPLUS SIMP) 1 ((MTIMES SIMP) 1 $X))) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 $X) <2 (SIGN1 $PNZ) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 ((MPLUS SIMP IRREDUCIBLE) 1 $X)) <2 (SIGN1 $PNZ) <1 (SIGN1 $PNZ) (%o2) x  1 > 0  >Comment By: Robert Dodier (robert_dodier) Date: 20070407 11:40 Message: Logged In: YES user_id=501686 Originator: YES Barton, thanks for investigating. Please go ahead and commit the new code. I don't understand exactly what is the purpose of MGRP (it seems like it is one of several functions to make comparisons and I don't see how the they all fit together) but I am more than willing to trust your judgement on this one.  Comment By: Barton Willis (willisbl) Date: 20070405 15:35 Message: Logged In: YES user_id=895922 Originator: NO I see that memq is no longer in Maxima. Replacing memq with a call to member, and appending an infsimp (may or may not be a good idea, I don't know), I built Maxima CVS using XP and sbcl 1.02. I passes the test suite. The code: (defun mgrp (a b) (setq a (infsimp (sub a b))) (let ((sgn (csign a))) (cond ((eq sgn '$pos) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((member sgn '($neg $zero $nz) :test #'eq) nil) (t `((mgreaterp) ,a 0))))) (defun mgqp (a b) (setq a (infsimp (sub a b))) (let ((sgn (csign a))) (cond ((member sgn '($pos $zero $pz) :test #'eq) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((eq sgn '$neg) nil) (t `((mgeqp) ,a 0)))))  Comment By: Barton Willis (willisbl) Date: 20070405 05:16 Message: Logged In: YES user_id=895922 Originator: NO An attempt at a fix: (defun mgrp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((eq sgn '$pos) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((memq sgn '($neg $zero $nz)) nil) (t `((mgreaterp) ,a 0))))) (defun mgqp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((memq sgn '($pos $zero $pz)) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((eq sgn '$neg) nil) (t `((mgeqp) ,a 0))))) Notes: (1) With these functions, the test suite gives an error break on rtest15; rtest16 #39 reports a problem about the sign of infinity; and rtestsum #5 reports that the result is correct, but that Maxima expected the result to be wrong. (2) The functions c$pos and friends may have some logic in them that I've overlooked. (3) The subtraction in my functions can be a problem for inf, minf, und, and ... (4) It's possible that my functions don't properly set the values of the 'evens', 'odds', and 'sign'. This scheme confuses me. I would like to expunge the functions c$pos and friends along with 'evens', 'odds', and 'sign'.  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 
From: SourceForge.net <noreply@so...>  20070413 11:11:15

Bugs item #1692651, was opened at 20070401 23:03 Message generated for change (Comment added) made by willisbl You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: None Status: Open Resolution: None Priority: 7 Private: No Submitted By: Robert Dodier (robert_dodier) Assigned to: Barton Willis (willisbl) Summary: MGRP gets sense of comparison backwards Initial Comment: The function MGRP (greaterthan comparison) can get the sense of the comparison backwards. MGRP is called indirectly from MEVALP and maybe other places as well. e.g. ?mgrp (x, 1); => x  1 > 0 (OK) ?mgrp (1, x); => x  1 > 0 (OOPS) I'm pretty sure the cause of this is the use of special variables in src/compar.lisp. I think what's happening is that SIGN1 calls itself, clobbering some of the specials. I believe the right way to fix this is to rework the comparison code to use only lexical variables instead of specials. For the record: (%i1) :lisp (trace sign1) (SIGN1) (%i1) ?mgrp (x, 1); 1> (SIGN1 ((MPLUS SIMP) 1 $X)) <1 (SIGN1 $PNZ) (%o1) x  1 > 0 (%i2) ?mgrp (1, x); 1> (SIGN1 ((MPLUS SIMP) 1 ((MTIMES SIMP) 1 $X))) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 $X) <2 (SIGN1 $PNZ) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 ((MPLUS SIMP IRREDUCIBLE) 1 $X)) <2 (SIGN1 $PNZ) <1 (SIGN1 $PNZ) (%o2) x  1 > 0  >Comment By: Barton Willis (willisbl) Date: 20070413 06:11 Message: Logged In: YES user_id=895922 Originator: NO The calls to infsimp aren't needed  the function sign1 does the infsimp. When 'memq' is restored, I'll patch mgrp and mgqp.  Comment By: Robert Dodier (robert_dodier) Date: 20070407 12:40 Message: Logged In: YES user_id=501686 Originator: YES Barton, thanks for investigating. Please go ahead and commit the new code. I don't understand exactly what is the purpose of MGRP (it seems like it is one of several functions to make comparisons and I don't see how the they all fit together) but I am more than willing to trust your judgement on this one.  Comment By: Barton Willis (willisbl) Date: 20070405 16:35 Message: Logged In: YES user_id=895922 Originator: NO I see that memq is no longer in Maxima. Replacing memq with a call to member, and appending an infsimp (may or may not be a good idea, I don't know), I built Maxima CVS using XP and sbcl 1.02. I passes the test suite. The code: (defun mgrp (a b) (setq a (infsimp (sub a b))) (let ((sgn (csign a))) (cond ((eq sgn '$pos) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((member sgn '($neg $zero $nz) :test #'eq) nil) (t `((mgreaterp) ,a 0))))) (defun mgqp (a b) (setq a (infsimp (sub a b))) (let ((sgn (csign a))) (cond ((member sgn '($pos $zero $pz) :test #'eq) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((eq sgn '$neg) nil) (t `((mgeqp) ,a 0)))))  Comment By: Barton Willis (willisbl) Date: 20070405 06:16 Message: Logged In: YES user_id=895922 Originator: NO An attempt at a fix: (defun mgrp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((eq sgn '$pos) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((memq sgn '($neg $zero $nz)) nil) (t `((mgreaterp) ,a 0))))) (defun mgqp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((memq sgn '($pos $zero $pz)) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((eq sgn '$neg) nil) (t `((mgeqp) ,a 0))))) Notes: (1) With these functions, the test suite gives an error break on rtest15; rtest16 #39 reports a problem about the sign of infinity; and rtestsum #5 reports that the result is correct, but that Maxima expected the result to be wrong. (2) The functions c$pos and friends may have some logic in them that I've overlooked. (3) The subtraction in my functions can be a problem for inf, minf, und, and ... (4) It's possible that my functions don't properly set the values of the 'evens', 'odds', and 'sign'. This scheme confuses me. I would like to expunge the functions c$pos and friends along with 'evens', 'odds', and 'sign'.  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 
From: SourceForge.net <noreply@so...>  20070419 20:07:00

Bugs item #1692651, was opened at 20070401 23:03 Message generated for change (Comment added) made by willisbl You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: None >Status: Pending >Resolution: Fixed Priority: 7 Private: No Submitted By: Robert Dodier (robert_dodier) Assigned to: Barton Willis (willisbl) Summary: MGRP gets sense of comparison backwards Initial Comment: The function MGRP (greaterthan comparison) can get the sense of the comparison backwards. MGRP is called indirectly from MEVALP and maybe other places as well. e.g. ?mgrp (x, 1); => x  1 > 0 (OK) ?mgrp (1, x); => x  1 > 0 (OOPS) I'm pretty sure the cause of this is the use of special variables in src/compar.lisp. I think what's happening is that SIGN1 calls itself, clobbering some of the specials. I believe the right way to fix this is to rework the comparison code to use only lexical variables instead of specials. For the record: (%i1) :lisp (trace sign1) (SIGN1) (%i1) ?mgrp (x, 1); 1> (SIGN1 ((MPLUS SIMP) 1 $X)) <1 (SIGN1 $PNZ) (%o1) x  1 > 0 (%i2) ?mgrp (1, x); 1> (SIGN1 ((MPLUS SIMP) 1 ((MTIMES SIMP) 1 $X))) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 $X) <2 (SIGN1 $PNZ) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 ((MPLUS SIMP IRREDUCIBLE) 1 $X)) <2 (SIGN1 $PNZ) <1 (SIGN1 $PNZ) (%o2) x  1 > 0  >Comment By: Barton Willis (willisbl) Date: 20070419 15:06 Message: Logged In: YES user_id=895922 Originator: NO Fixed by CVS revsion 1.23.  Comment By: Barton Willis (willisbl) Date: 20070413 06:11 Message: Logged In: YES user_id=895922 Originator: NO The calls to infsimp aren't needed  the function sign1 does the infsimp. When 'memq' is restored, I'll patch mgrp and mgqp.  Comment By: Robert Dodier (robert_dodier) Date: 20070407 12:40 Message: Logged In: YES user_id=501686 Originator: YES Barton, thanks for investigating. Please go ahead and commit the new code. I don't understand exactly what is the purpose of MGRP (it seems like it is one of several functions to make comparisons and I don't see how the they all fit together) but I am more than willing to trust your judgement on this one.  Comment By: Barton Willis (willisbl) Date: 20070405 16:35 Message: Logged In: YES user_id=895922 Originator: NO I see that memq is no longer in Maxima. Replacing memq with a call to member, and appending an infsimp (may or may not be a good idea, I don't know), I built Maxima CVS using XP and sbcl 1.02. I passes the test suite. The code: (defun mgrp (a b) (setq a (infsimp (sub a b))) (let ((sgn (csign a))) (cond ((eq sgn '$pos) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((member sgn '($neg $zero $nz) :test #'eq) nil) (t `((mgreaterp) ,a 0))))) (defun mgqp (a b) (setq a (infsimp (sub a b))) (let ((sgn (csign a))) (cond ((member sgn '($pos $zero $pz) :test #'eq) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((eq sgn '$neg) nil) (t `((mgeqp) ,a 0)))))  Comment By: Barton Willis (willisbl) Date: 20070405 06:16 Message: Logged In: YES user_id=895922 Originator: NO An attempt at a fix: (defun mgrp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((eq sgn '$pos) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((memq sgn '($neg $zero $nz)) nil) (t `((mgreaterp) ,a 0))))) (defun mgqp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((memq sgn '($pos $zero $pz)) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((eq sgn '$neg) nil) (t `((mgeqp) ,a 0))))) Notes: (1) With these functions, the test suite gives an error break on rtest15; rtest16 #39 reports a problem about the sign of infinity; and rtestsum #5 reports that the result is correct, but that Maxima expected the result to be wrong. (2) The functions c$pos and friends may have some logic in them that I've overlooked. (3) The subtraction in my functions can be a problem for inf, minf, und, and ... (4) It's possible that my functions don't properly set the values of the 'evens', 'odds', and 'sign'. This scheme confuses me. I would like to expunge the functions c$pos and friends along with 'evens', 'odds', and 'sign'.  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 
From: SourceForge.net <noreply@so...>  20070504 02:20:17

Bugs item #1692651, was opened at 20070401 21:03 Message generated for change (Comment added) made by sfrobot You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: None >Status: Closed Resolution: Fixed Priority: 7 Private: No Submitted By: Robert Dodier (robert_dodier) Assigned to: Barton Willis (willisbl) Summary: MGRP gets sense of comparison backwards Initial Comment: The function MGRP (greaterthan comparison) can get the sense of the comparison backwards. MGRP is called indirectly from MEVALP and maybe other places as well. e.g. ?mgrp (x, 1); => x  1 > 0 (OK) ?mgrp (1, x); => x  1 > 0 (OOPS) I'm pretty sure the cause of this is the use of special variables in src/compar.lisp. I think what's happening is that SIGN1 calls itself, clobbering some of the specials. I believe the right way to fix this is to rework the comparison code to use only lexical variables instead of specials. For the record: (%i1) :lisp (trace sign1) (SIGN1) (%i1) ?mgrp (x, 1); 1> (SIGN1 ((MPLUS SIMP) 1 $X)) <1 (SIGN1 $PNZ) (%o1) x  1 > 0 (%i2) ?mgrp (1, x); 1> (SIGN1 ((MPLUS SIMP) 1 ((MTIMES SIMP) 1 $X))) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 $X) <2 (SIGN1 $PNZ) 2> (SIGN1 1) <2 (SIGN1 $NEG) 2> (SIGN1 ((MPLUS SIMP IRREDUCIBLE) 1 $X)) <2 (SIGN1 $PNZ) <1 (SIGN1 $PNZ) (%o2) x  1 > 0  >Comment By: SourceForge Robot (sfrobot) Date: 20070503 19:20 Message: Logged In: YES user_id=1312539 Originator: NO This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).  Comment By: Barton Willis (willisbl) Date: 20070419 13:06 Message: Logged In: YES user_id=895922 Originator: NO Fixed by CVS revsion 1.23.  Comment By: Barton Willis (willisbl) Date: 20070413 04:11 Message: Logged In: YES user_id=895922 Originator: NO The calls to infsimp aren't needed  the function sign1 does the infsimp. When 'memq' is restored, I'll patch mgrp and mgqp.  Comment By: Robert Dodier (robert_dodier) Date: 20070407 10:40 Message: Logged In: YES user_id=501686 Originator: YES Barton, thanks for investigating. Please go ahead and commit the new code. I don't understand exactly what is the purpose of MGRP (it seems like it is one of several functions to make comparisons and I don't see how the they all fit together) but I am more than willing to trust your judgement on this one.  Comment By: Barton Willis (willisbl) Date: 20070405 14:35 Message: Logged In: YES user_id=895922 Originator: NO I see that memq is no longer in Maxima. Replacing memq with a call to member, and appending an infsimp (may or may not be a good idea, I don't know), I built Maxima CVS using XP and sbcl 1.02. I passes the test suite. The code: (defun mgrp (a b) (setq a (infsimp (sub a b))) (let ((sgn (csign a))) (cond ((eq sgn '$pos) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((member sgn '($neg $zero $nz) :test #'eq) nil) (t `((mgreaterp) ,a 0))))) (defun mgqp (a b) (setq a (infsimp (sub a b))) (let ((sgn (csign a))) (cond ((member sgn '($pos $zero $pz) :test #'eq) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((eq sgn '$neg) nil) (t `((mgeqp) ,a 0)))))  Comment By: Barton Willis (willisbl) Date: 20070405 04:16 Message: Logged In: YES user_id=895922 Originator: NO An attempt at a fix: (defun mgrp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((eq sgn '$pos) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((memq sgn '($neg $zero $nz)) nil) (t `((mgreaterp) ,a 0))))) (defun mgqp (a b) (setq a (sub a b)) (let ((sgn (csign a))) (cond ((memq sgn '($pos $zero $pz)) t) ((eq sgn t) nil) ;; csign thinks a  b isn't real ((eq sgn '$neg) nil) (t `((mgeqp) ,a 0))))) Notes: (1) With these functions, the test suite gives an error break on rtest15; rtest16 #39 reports a problem about the sign of infinity; and rtestsum #5 reports that the result is correct, but that Maxima expected the result to be wrong. (2) The functions c$pos and friends may have some logic in them that I've overlooked. (3) The subtraction in my functions can be a problem for inf, minf, und, and ... (4) It's possible that my functions don't properly set the values of the 'evens', 'odds', and 'sign'. This scheme confuses me. I would like to expunge the functions c$pos and friends along with 'evens', 'odds', and 'sign'.  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1692651&group_id=4933 