From aaaed3531c3f6de325bb3afcb5f57257523552b1 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Tue, 3 Sep 2013 16:30:13 +0000
Subject: [PATCH] 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]]
---
 dune/gfe/rotation.hh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dune/gfe/rotation.hh b/dune/gfe/rotation.hh
index e0ac46af..28198eff 100644
--- a/dune/gfe/rotation.hh
+++ b/dune/gfe/rotation.hh
@@ -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:
-- 
GitLab