Bugfix for scalar AutoDiff class.

Missing chain-rule usage in Scalar/AD operator.
This commit is contained in:
Atgeirr Flø Rasmussen 2015-06-25 07:00:26 +02:00
parent 91af12034c
commit 5977590e70

View File

@ -256,7 +256,7 @@ namespace Opm
const AutoDiff<Scalar>& rhs)
{
Scalar a = Scalar(lhs) / rhs.val();
Scalar b = -Scalar(lhs) / (rhs.val() * rhs.val());
Scalar b = (-Scalar(lhs) / (rhs.val() * rhs.val())) * rhs.der();
return AutoDiff<Scalar>::function(a, b);
}