(in-package :division) #+nil (let ((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)))) ) (multiple-value-bind (f c division-count) (step (normal-form f fl)) (format t "Quotient: ~S~%" (->sexp f)) (format t "Coefficient: ~S~%" c) (format t "Division count: ~S~%" division-count))) (let ((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)))) ) (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)))