Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2008-06-30 05:01:05


Author: johnmaddock
Date: 2008-06-30 05:01:05 EDT (Mon, 30 Jun 2008)
New Revision: 46891
URL: http://svn.boost.org/trac/boost/changeset/46891

Log:
Added log1p rational code.
Text files modified:
   sandbox/math_toolkit/libs/math/minimax/f.cpp | 8 ++++++++
   1 files changed, 8 insertions(+), 0 deletions(-)

Modified: sandbox/math_toolkit/libs/math/minimax/f.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/minimax/f.cpp (original)
+++ sandbox/math_toolkit/libs/math/minimax/f.cpp 2008-06-30 05:01:05 EDT (Mon, 30 Jun 2008)
@@ -310,6 +310,14 @@
          y = sqrt(y);
          return boost::math::erf_inv(y) / (y);
       }
+ case 28:
+ {
+ // log1p over [-0.5,0.5]
+ boost::math::ntl::RR y = x;
+ if(fabs(y) < 1e-100)
+ y = (y == 0) ? 1e-100 : boost::math::sign(y) * 1e-100;
+ return (boost::math::log1p(y) - y + y * y / 2) / (y);
+ }
    }
    return 0;
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk