Skip to content

Commit

Permalink
Bug fix in sr_smonotonic: avoid a floating point rounding error
Browse files Browse the repository at this point in the history
  • Loading branch information
lathuili committed Oct 3, 2024
1 parent 7080042 commit 9340766
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions interflop_backends/interflop_verrou/vr_roundingOp.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,11 @@ public:
}else{
resm=nextAwayFromZero<RealType>(res);
const RealType resHash(-resp);
const RealType limit=1.-RAND::randRatioFromResult(&vr_rand, &resHash);
// const RealType limit=1.-RAND::randRatioFromResult(&vr_rand, &resHash);
const RealType x=RAND::randRatioFromResult(&vr_rand, &resHash);
const RealType u(resp-resm);
const RealType errorTh(u+error);
down =( errorTh <= (limit * u));
// const RealType errorTh(u+error);
down =( error <= (-x) * u);
}

}
Expand Down

0 comments on commit 9340766

Please sign in to comment.