How would one write the following ocaml expression in clojure:
fun x -> (f (x +. dx) -. f x) /. dx
I simplehearted tried the following expression, but that throws an exception:
(defn derivative [dx f]
(fn [x]
(/ (- f [(+ x dx)] f [x]) dx)))
((derivative 0.01 (fn [x] (* x x))) 1)
java.lang.ClassCastException: ableitung$eval5058$fn__5059 cannot be cast to java.lang.Number Numbers.java:135 clojure.lang.Numbers.minus