(defmacro deriv-fn
"
Examples:
(use '(incanter core symbolic))
(deriv-fn [x y] (+ (* x y) x) x)
((deriv-fn [x y] (+ (* x y) x) x) 5 9)
(use 'incanter.charts)
(doto (function-plot sin -5 5)
(add-function (deriv-fn [x] (sin x) x) -5 5)
(add-function (deriv-fn [x] (sin x) x 2) -5 5)
view)
(let [f (fn [x] (pow x 2))
df (deriv-fn [x] (pow x 2) x)]
(doto (function-plot f -5 5)
(add-function df -5 5)
view))
(let [f (fn [x] (pow x 3))
df (deriv-fn [x] (pow x 3) x)]
(doto (function-plot f -5 5)
(add-function df -5 5)
view))
;; NOT WORKING YET
(let [f (fn [x] (/ 1 x ))
df (deriv-fn [x] (/ 1 x) x)]
(doto (function-plot f 0.5 5)
(add-function df 0.5 5)
view))
"
([[& args] expr v]
`(deriv-fn* '[~@args] '~expr '~v 1))
([[& args] expr v degree]
`(deriv-fn* '[~@args] '~expr '~v ~degree)))
Used in 0 other vars
Comments top
No comments for deriv-fn. Log in to add a comment.