Skip to content

Commit

Permalink
Test prob against ScalarEpsilon
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmure committed Apr 12, 2024
1 parent fdca7b1 commit caa14a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/Uncertainty/Distribution/ClaytonCopula.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,10 @@ Point ClaytonCopula::computeQuantile(const Scalar prob,
// General case
if (tail)
{
if (prob < 1e-8) return Point(2, 1.0 - prob / 2.0);
if (prob < std::sqrt(SpecFunc::ScalarEpsilon)) return Point(2, 1.0 - prob / 2.0);
return Point(2, std::exp((M_LN2 - log1p(std::exp(-theta_ * log1p(-prob)))) / theta_));
}
if (1.0 - prob < 1e-8) return Point(2, (1.0 + prob) / 2.0);
if (1.0 - prob < std::sqrt(SpecFunc::ScalarEpsilon)) return Point(2, (1.0 + prob) / 2.0);
return Point(2, std::exp((M_LN2 - log1p(std::pow(prob, -theta_))) / theta_));
}

Expand Down

0 comments on commit caa14a0

Please sign in to comment.