Hacker News new | ask | show | jobs
by krastanov 1374 days ago
Not quite. This subthread is about the extremely short, one-line implementation mentioned here https://news.ycombinator.com/item?id=32882825 (which merges two unrelated modules (autodiff and symbolic) and uses autodiff to implement symbolic differentiation). Your comment is true for the original 38-line implemention of autodiff at the very top of the thread, but not in this subthread. The 38-line implementation is similar to the aforementioned autodiff module though.
2 comments

However, if the symbolic package knows that

cos(a+b) == cos(a)cos(b) - sin(a)sin(b)

then it works.

Something must be known in advance about the relationship between sin and cos for addition, otherwise you cannot go from one to the other (and the basic

cos(a)^2+sin(a)^2=1

is not enough for that.

Yes, indeed, I was referring to TFA, and obviously I was confused.