Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2007-08-02 08:06:15


Author: johnmaddock
Date: 2007-08-02 08:06:13 EDT (Thu, 02 Aug 2007)
New Revision: 38396
URL: http://svn.boost.org/trac/boost/changeset/38396

Log:
Fixed gamma-function regressions.
Tidied up function calls in t_distribution_inv.hpp.
Tidied up casts in erf.hpp
Text files modified:
   sandbox/math_toolkit/boost/math/special_functions/detail/t_distribution_inv.hpp | 6 +++---
   sandbox/math_toolkit/boost/math/special_functions/erf.hpp | 4 ++--
   sandbox/math_toolkit/boost/math/special_functions/gamma.hpp | 6 +++++-
   3 files changed, 10 insertions(+), 6 deletions(-)

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/t_distribution_inv.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/t_distribution_inv.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/t_distribution_inv.hpp 2007-08-02 08:06:13 EDT (Thu, 02 Aug 2007)
@@ -68,7 +68,7 @@
 // Journal of Computational Finance, Vol 9 Issue 4, pp 37-73, Summer 2006
 //
 template <class T, class Policy>
-T inverse_students_t_tail_series(T df, T v, T /* u */, const Policy& pol)
+T inverse_students_t_tail_series(T df, T v, const Policy& pol)
 {
    using namespace std;
    // Tail series expansion, see section 6 of Shaw's paper.
@@ -354,7 +354,7 @@
          }
          else
          {
- result = boost::math::detail::inverse_students_t_tail_series(df, u, v, pol);
+ result = boost::math::detail::inverse_students_t_tail_series(df, u, pol);
          }
       }
       else
@@ -371,7 +371,7 @@
          }
          else
          {
- result = boost::math::detail::inverse_students_t_tail_series(df, u, v, pol);
+ result = boost::math::detail::inverse_students_t_tail_series(df, u, pol);
          }
       }
    }

Modified: sandbox/math_toolkit/boost/math/special_functions/erf.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/erf.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/erf.hpp 2007-08-02 08:06:13 EDT (Thu, 02 Aug 2007)
@@ -195,13 +195,13 @@
       }
       else if(z < 1e-10)
       {
- result = T(z * 1.125 + z * 0.003379167095512573896158903121545171688L);
+ result = static_cast<T>(z * 1.125f + z * 0.003379167095512573896158903121545171688L);
       }
       else
       {
          static const T n[7] = { 0.00337916709551257778174L, -0.000147024115786688745475L, -0.37463022236812520164L, 0.0163061594494816999803L, -0.0534354147807331748737L, 0.00161898096813581982844L, -0.0059528010489182840404L };
          static const T d[7] = { 1, -0.0435089806536379531594L, 0.442761965043509204727L, -0.017375974533016704678L, 0.0772756490303260060769L, -0.00210552465858669941879L, 0.00544772980263244037286L };
- result = T(z * 1.125 + z * tools::evaluate_polynomial(n, z) / tools::evaluate_polynomial(d, z));
+ result = static_cast<T>(z * 1.125f + z * tools::evaluate_polynomial(n, z) / tools::evaluate_polynomial(d, z));
       }
    }
    else if((z < 14) || ((z < 28) && invert))

Modified: sandbox/math_toolkit/boost/math/special_functions/gamma.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/gamma.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/gamma.hpp 2007-08-02 08:06:13 EDT (Thu, 02 Aug 2007)
@@ -435,7 +435,11 @@
          mpl::less_equal<precision_type, mpl::int_<0> >,
          mpl::greater<precision_type, mpl::int_<113> >
>,
- mpl::int_<0>,
+ typename mpl::if_<
+ is_same<L, lanczos::lanczos24m113>,
+ mpl::int_<113>,
+ mpl::int_<0>
+ >::type,
       typename mpl::if_<
          mpl::less_equal<precision_type, mpl::int_<64> >,
          mpl::int_<64>, mpl::int_<113> >::type


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