6 ms·
Does this implement symbolic algebra/calculus, or is it entirely numerical?
by tobinfricke 3y ago
Does this implement symbolic algebra/calculus, or is it entirely numerical?
- tikhonj 3y agoNo idea if this book does it, but this seems like a perfect fit for automatic differentiation. You can get a simple implementation of automatic differentiation for one dimension in a small amount of surprisingly clear code, without needing to pull in any dependencies or extraneous concepts.
- tobinfricke 3y agoThat is along the lines of the motivation for my question. Automatic differentiation is such a natural fit with Haskell...
- lagrange77 3y ago> this seems like a perfect fit for automatic differentiation. Why?
- tikhonj 3y agoIt would let you represent physical systems as normal Haskell functions and get accurate derivatives "for free". At least in the one-dimensional case it's probably simpler than numeric differentiation while also letting you worry far less about accuracy and stability. I've never worked this through to a full conclusion, but you could even write it in a way that would let you get symbolic differentiation out of it too.
- lagrange77 3y agoMakes sense. I initially thought, that automatic differentiation would be mostly useful for long derivative chains, but of course even for single derivatives it does have advantages.
- sritchie 3y agoYes, if you get to automatic differentiation by overloading your operators to also take a “differential” type, you can further overload them to do symbolic arithmetic and then symbolic differentiation falls out for free. See https://sritchie.github.io/emmy/src/emmy/differential.html https://sritchie.github.io/emmy/src/emmy/differential.html for detail!