2 ms·
I'm not a math guy, but I've gotten incredible usage out of Dual numbers over the years. Highly recommended.
by erichocean 10y ago
I'm not a math guy, but I've gotten incredible usage out of Dual numbers over the years. Highly recommended.
- amelius 10y agoCould you elaborate? Imho, the article is not very convincing, since Dual numbers require double amount of work per operation (making the computation of the derivative not "free" or "automatic"). The concept, however, seems very interesting, so I'm wondering about other applications.
- zardo 10y agoYou don't need to use it if you don't need the derivative. If you do need the derivative, then it isn't double the work because you would have needed to call a separate function for it anyways. Had I known about it at the time, it would have saved me a few headaches when I was writing a game mod that computed orbital intercepts.
- erichocean 10y agoTo follow up on what @zardo said, it's also not "double the amount of work" in a language like C++ on the coding side, because you just replace `float` or `double` by your Dual number type and read off the derivatives as needed. So, the "work" is almost nothing vs. computing derivatives by hand, which requires entirely different math. Furthermore, the actual CPU instructions are generally lower with a Dual implementation, usually because transcendentals and the like aren't computed over and over again—although this is obviously computation-dependent. An example of a project that uses automatic differentiation in a really useful way is the Ceres Solver.[0] [0] http://ceres-solver.org/ http://ceres-solver.org/