Skip to content

Commit

Permalink
Fixed Energy Gradient's error estimator
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithanil committed Jul 30, 2019
1 parent 73661ff commit e1253a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EnergyGradientTargetFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ nfm::NoisyValue EnergyGradientTargetFunction::fgrad(const std::vector<double> &v
grad.val[i] = -2.*(HOi[i] - H[0]*Oi[i]);
}
if (this->hasGradErr()) {
for (int i = 0; i < nvp; ++i) {
grad.err[i] = 2.*(dHOi[i] + fabs(H[0]*Oi[i])*(dH[0]/H[0] + dOi[i]/Oi[i]));
for (int i = 0; i < nvp; ++i) { // error propagation
grad.err[i] = 2.*sqrt(dHOi[i]*dHOi[i] + dH[0]*dH[0]*Oi[i]*Oi[i] + H[0]*H[0]*dOi[i]*dOi[i]);
}
}

Expand Down

0 comments on commit e1253a8

Please sign in to comment.