Skip to content
Snippets Groups Projects
Commit aaaed353 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Also use the second order term of the series expansion of sin(x/2)/x

Makes for a more precise Hessian matrix when using automatic differentiation.

[[Imported from SVN: r9425]]
parent c4a27bc9
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,7 @@ class Rotation<T,3> : public Quaternion<T>
/** \brief Computes sin(x/2) / x without getting unstable for small x */
static T sincHalf(const T& x) {
return (x < 1e-4) ? 0.5 - (x*x/48) : std::sin(x/2)/x;
return (x < 1e-4) ? 0.5 - (x*x/48) + (x*x*x*x)/3840 : std::sin(x/2)/x;
}
public:
......
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