From 6f03e36cdfab6d4590e5dfb67fcf034acc3ebb33 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Tue, 5 Apr 2011 18:44:00 +0000 Subject: [PATCH] fix sign bug in the series expansion of sin(x/2)/x. Thanks to Jonathan Youett for pointing this out [[Imported from SVN: r7095]] --- 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 51c9231b..e002b6ca 100644 --- a/dune/gfe/rotation.hh +++ b/dune/gfe/rotation.hh @@ -125,7 +125,7 @@ class Rotation<3,T> : 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) : std::sin(x/2)/x; } /** \brief Compute the derivative of arccos^2 without getting unstable for x close to 1 */ -- GitLab