3 ms·
Lisp is definitely not doing symbolic algebra and finding a pure analytical answer like that under the hood - symbolic math, differentiation rules etc. are a wh
by QuadrupleA 8y ago
Lisp is definitely not doing symbolic algebra and finding a pure analytical answer like that under the hood - symbolic math, differentiation rules etc. are a whole other beast (see SymPy for example).
Maybe that's the misunderstanding in the original article that made it seem so mindblowing?
Evaluating (f(5.0001) - f(5.0)) / 0.0001 just gives an approximation of the derivative at a certain point in the function (aka the "finite difference method").
- taeric 8y agoSymbolic derivatives are one of the very next sections in the famous lisp lectures that this was watching.
- QuadrupleA 8y agoInteresting - for symbolic differentiation I imagine it's about code-manipulation rules for e.g. calculus' product rule, chain rule etc.?
- taeric 8y agoEssentially, yes. And if you want it to be pretty, it gets complicated quickly. https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-16.html#%_sec_2.3.2 https://mitpress.mit.edu/sites/default/files/sicp/full-text/... is the chapter. Turns out it wasn't the "very next" one. But it is in my head.
- yen223 8y agoHere's symbolic differentiation done in ~20 lines of Haskell: https://www.quora.com/What-are-20-lines-of-code-that-capture-the-essence-of-Haskell-Try-to-follow-standard-Haskell-style-Comments-and-spaces-between-code-do-not-count-as-lines-They-can-also-consist-of-individual-snippets-of-code-but-have-to-add-up-to-20-lines https://www.quora.com/What-are-20-lines-of-code-that-capture...