Operator *=(): Use correct derivative chain rule

Updating the derivative using '*=' is just plain wrong.
This commit is contained in:
Bård Skaflestad 2013-04-29 23:53:31 +02:00
parent 72d6d32095
commit 011ab5ee93

View File

@ -96,7 +96,7 @@ namespace AutoDiff {
Forward&
operator *=(const Forward& rhs)
{
dx_ *= dx_*rhs.x_ + x_*rhs.dx_;
dx_ = dx_*rhs.x_ + x_*rhs.dx_;
x_ *= rhs.x_;
return *this;