Closed fjames86 closed 11 years ago
should be possible to write a macro that "compiles" a polynomial structure into a standard function. e.g. something like
(defpoly myp #{x + y^2})
->
(defun myp (x y) (+ 0 (* 1 x) (* 0 y) (* 0 x x) (* 0 x y) (* 1 y y)))
Could of course easily make it more efficient by not including zero-coefficient terms and tracking exponents.
started writing it, work in progress.
should be possible to write a macro that "compiles" a polynomial structure into a standard function. e.g. something like
(defpoly myp #{x + y^2})
->
(defun myp (x y) (+ 0 (* 1 x) (* 0 y) (* 0 x x) (* 0 x y) (* 1 y y)))
Could of course easily make it more efficient by not including zero-coefficient terms and tracking exponents.