(in-package :division) (proclaim '(special f fl)) (setf f (string->poly "x^2" '(x y)) ;;y-sq (string->poly "y^2" '(x y)) fl (cdr (string->poly "[x+y,x-2*y]" '(x y))) ;;quotients (cdr (string->poly "[x-y,0]" '(x y))) ) #+nil (multiple-value-bind (f c division-count) (normal-form f fl) (format t "Quotient: ~S~%" (->sexp f)) (format t "Coefficient: ~S~%" c) (format t "Division count: ~S~%" division-count)) (multiple-value-bind (a r c division-count) (poly-pseudo-divide f fl) (format t "Quotients: ~S~%" (poly->string (cons :[ a) '(x y))) (format t "Remainder: ~S~%" (->sexp r '(x y))) (format t "Coefficient: ~S~%" c) (format t "Division count: ~S~%" division-count))