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

Bugfix: Grassia's sign bug in the power series of the sinc function was here, too

[[Imported from SVN: r7195]]
parent ce4902bd
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ class UnitVector ...@@ -15,7 +15,7 @@ class UnitVector
{ {
/** \brief Computes sin(x/2) / x without getting unstable for small x */ /** \brief Computes sin(x/2) / x without getting unstable for small x */
static double sinc(const double& x) { static double sinc(const double& x) {
return (x < 1e-4) ? 1 + (x*x/6) : std::sin(x)/x; return (x < 1e-4) ? 1 - (x*x/6) : std::sin(x)/x;
} }
/** \brief Compute the derivative of arccos^2 without getting unstable for x close to 1 */ /** \brief Compute the derivative of arccos^2 without getting unstable for x close to 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