(and (eq (car-safe b) '^)
(Math-looks-negp (nth 2 b))
(not (and (eq (car-safe a) '^) (Math-looks-negp (nth 2 a))))
+ (not (math-known-matrixp (nth 1 b)))
(math-div a (math-normalize
(list '^ (nth 1 b) (math-neg (nth 2 b))))))
(and (eq (car-safe a) '/)
(list 'calcFunc-idn (math-mul a (nth 1 b))))
(and (math-known-matrixp a)
(math-mul a (nth 1 b)))))
+ (and (math-identity-matrix-p a t)
+ (or (and (eq (car-safe b) 'calcFunc-idn)
+ (= (length b) 2)
+ (list 'calcFunc-idn (math-mul
+ (nth 1 (nth 1 a))
+ (nth 1 b))
+ (1- (length a))))
+ (and (math-known-scalarp b)
+ (list 'calcFunc-idn (math-mul
+ (nth 1 (nth 1 a)) b)
+ (1- (length a))))
+ (and (math-known-matrixp b)
+ (math-mul (nth 1 (nth 1 a)) b))))
+ (and (math-identity-matrix-p b t)
+ (or (and (eq (car-safe a) 'calcFunc-idn)
+ (= (length a) 2)
+ (list 'calcFunc-idn (math-mul (nth 1 a)
+ (nth 1 (nth 1 b)))
+ (1- (length b))))
+ (and (math-known-scalarp a)
+ (list 'calcFunc-idn (math-mul a (nth 1 (nth 1 b)))
+ (1- (length b))))
+ (and (math-known-matrixp a)
+ (math-mul a (nth 1 (nth 1 b))))))
(and (math-looks-negp b)
(math-mul (math-neg a) (math-neg b)))
(and (eq (car-safe b) '-)
(math-div-new-non-trig term))))
(defun math-div-symb-fancy (a b)
- (or (and math-simplify-only
+ (or (and (math-known-matrixp b)
+ (math-mul a (math-pow b -1)))
+ (and math-simplify-only
(not (equal a math-simplify-only))
(list '/ a b))
(and (Math-equal-int b 1) a)