Skip to content
Snippets Groups Projects
Commit 97b322c6 authored by Oliver Sander's avatar Oliver Sander Committed by sander@FU-BERLIN.DE
Browse files

bugfix: only use series expansion close to 1

[[Imported from SVN: r9083]]
parent b61bc8d9
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ class HyperbolicHalfspacePoint
/** \brief Compute the derivative of arccosh^2 without getting unstable for x close to 1 */
static T derivativeOfArcCosHSquared(const T& x) {
const T eps = 1e-4;
if (x > 1-eps) { // regular expression is unstable, use the series expansion instead
if (x < 1+eps) { // regular expression is unstable, use the series expansion instead
return 2 - 2*(x-1)/3 + 4/15*(x-1)*(x-1);
} else
return 2*std::acosh(x) / std::sqrt(x*x-1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment