|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r48899 - in sandbox/math_toolkit: boost/math/special_functions libs/math/test
From: john_at_[hidden]
Date: 2008-09-19 12:42:41
Author: johnmaddock
Date: 2008-09-19 12:42:41 EDT (Fri, 19 Sep 2008)
New Revision: 48899
URL: http://svn.boost.org/trac/boost/changeset/48899
Log:
Add support for ellint_3 in the difficult previously unsupported region.
Text files modified:
sandbox/math_toolkit/boost/math/special_functions/ellint_3.hpp | 8 ++++++--
sandbox/math_toolkit/libs/math/test/test_ellint_3.cpp | 8 +++++---
2 files changed, 11 insertions(+), 5 deletions(-)
Modified: sandbox/math_toolkit/boost/math/special_functions/ellint_3.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/ellint_3.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/ellint_3.hpp 2008-09-19 12:42:41 EDT (Fri, 19 Sep 2008)
@@ -191,7 +191,10 @@
sign = -1;
rphi = constants::pi<T>() / 2 - rphi;
}
-
+#if 0
+ //
+ // This wasn't supported but is now... probably!
+ //
if((m > 0) && (v > 1))
{
//
@@ -202,6 +205,7 @@
function,
"Got v = %1%, but this is only supported for 0 <= phi <= pi/2", v, pol);
}
+#endif
T sinp = sin(rphi);
T cosp = cos(rphi);
x = cosp * cosp;
@@ -213,7 +217,7 @@
else
p = x + vc * t;
value = sign * sinp * (ellint_rf_imp(x, y, z, pol) + v * t * ellint_rj_imp(x, y, z, p, pol) / 3);
- if(m > 0)
+ if((m > 0) && (vc > 0))
value += m * ellint_pi_imp(v, k, vc, pol);
}
Modified: sandbox/math_toolkit/libs/math/test/test_ellint_3.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_ellint_3.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_ellint_3.cpp 2008-09-19 12:42:41 EDT (Fri, 19 Sep 2008)
@@ -159,7 +159,7 @@
{
// function values calculated on http://functions.wolfram.com/
#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
- static const boost::array<boost::array<T, 4>, 21> data1 = {
+ static const boost::array<boost::array<T, 4>, 25> data1 = {
SC_(1), SC_(-1), SC_(0), SC_(-1.557407724654902230506974807458360173087),
SC_(0), SC_(-4), SC_(0.4), SC_(-4.153623371196831087495427530365430979011),
SC_(0), SC_(8), SC_(-0.6), SC_(8.935930619078575123490612395578518914416),
@@ -181,8 +181,10 @@
1-SC_(1) / 1024, SC_(1e+20), SC_(0.875), SC_(6.43274293944380717581167058274600202023334985100499739678963e21),
SC_(50), SC_(0.1), SC_(0.25), SC_(0.124573770342749525407523258569507331686458866564082916835900),
SC_(1.125), SC_(1), SC_(0.25), SC_(1.77299767784815770192352979665283069318388205110727241629752),
- //SC_(1.125), SC_(10), SC_(0.25), SC_(0.662467818678976949597336360256848770217429434745967677192487),
- //SC_(1.125), SC_(3), SC_(0.25), SC_(-0.142697285116693775525461312178015106079842313950476205580178),
+ SC_(1.125), SC_(10), SC_(0.25), SC_(0.662467818678976949597336360256848770217429434745967677192487),
+ SC_(1.125), SC_(3), SC_(0.25), SC_(-0.142697285116693775525461312178015106079842313950476205580178),
+ SC_(257)/256, SC_(1.5), SC_(0.1), SC_(22.2111124684047142809404895720078056163182744133864821626782),
+ SC_(257)/256, SC_(21.5), SC_(0.1), SC_(-0.535282720703701002972775208780096689181320029073372524045546),
};
#undef SC_
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