From: <noreply@so...>  20021030 19:54:27

Bugs item #631216, was opened at 20021030 14:54 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=631216&group_id=4933 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stavros Macrakis (macrakis) Assigned to: Nobody/Anonymous (nobody) Summary: horner([...],x)/FIX Initial Comment: Horner of a list/matrix/equation returns the argument. Looking at the code shows that it is intended to map across these aggregates (or bags as they're called). The problem is that it is putting the argument in rational form *before* checking whether it is a bag. There are two possible ways to fix it. First is to modify Horner. (defmfun $horner (expr &rest vars) (if (mbagp expr) (cons (car expr) (mapcar #'(lambda (u) (apply '$horner u vars)) (cdr expr))) (let* (($ratfac nil) (varlist (cdr $ratvars)) (genvar nil) (x (apply '$rat (taychk2rat expr) vars))) (mapc #'(lambda (y z) (putprop y z 'disrep)) (cadddr (car x)) (caddar x)) (div* (hornrep (cadr x)) (hornrep (cddr x)))))) The cleaner way is to modify taychk2rat to use $rat instead of ratf. In that case, ratnumer and ratdenom also need to be modified to explicity check mbagp. The only other use of taychk2rat is in partfrac, and this change doesn't bother it. The only risk to doing this is if there is user code that depends on (e.g) ratnumer([x/y]) returning [x/y] rather than [x], which seems highly unlikely. (DEFMFUN $RATNUMER (X) (IF (MBAGP X) (CONS (CAR X) (MAPCAR '$RATNUMER (CDR X))) (SETQ X (TAYCHK2RAT X)) (CONS (CAR X) (CONS (CADR X) 1)))) (DEFMFUN $RATDENOM (X) (IF (MBAGP X) (CONS (CAR X) (MAPCAR '$RATDENOM (CDR X))) (SETQ X (TAYCHK2RAT X)) (CONS (CAR X) (CONS (CDDR X) 1)))) (DEFUN TAYCHK2RAT (X) (COND ((AND ($RATP X) (MEMQ 'TRUNC (CDAR X))) ($TAYTORAT X)) (T ($RAT X))))  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=631216&group_id=4933 