# Boost-Commit :

Date: 2007-06-05 05:15:22

Date: 2007-06-05 05:15:22 EDT (Tue, 05 Jun 2007)
New Revision: 4451
URL: http://svn.boost.org/trac/boost/changeset/4451

Log:
Bug fix: fancy logic only works for arguments > 1, just use straight sin/cos evaluation for small args.

Text files modified:
sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp | 2 ++
sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp | 2 ++
2 files changed, 4 insertions(+), 0 deletions(-)

Modified: sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/cos_pi.hpp 2007-06-05 05:15:22 EDT (Tue, 05 Jun 2007)
@@ -17,6 +17,8 @@
using namespace std; // ADL of std names
// cos of pi*x:
bool invert = false;
+ if(x < 0.5)
+ return cos(constants::pi<T>() * x);
if(x < 1)
{
x = -x;

Modified: sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/sin_pi.hpp 2007-06-05 05:15:22 EDT (Tue, 05 Jun 2007)
@@ -17,6 +17,8 @@
using namespace std; // ADL of std names
// sin of pi*x:
bool invert;
+ if(x < 0.5)
+ return sin(constants::pi<T>() * x);
if(x < 1)
{
invert = true;