|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r78811 - in sandbox/big_number/libs/multiprecision: doc doc/html doc/html/boost_multiprecision/indexes doc/html/boost_multiprecision/ref performance
From: john_at_[hidden]
Date: 2012-06-05 06:40:58
Author: johnmaddock
Date: 2012-06-05 06:40:56 EDT (Tue, 05 Jun 2012)
New Revision: 78811
URL: http://svn.boost.org/trac/boost/changeset/78811
Log:
Add performance test comparing double to mp_number<float_backend<double>>.
Fix typo in docs and regenerate.
Added:
sandbox/big_number/libs/multiprecision/performance/float_backend.hpp (contents, props changed)
Text files modified:
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s01.html | 4 ++--
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s02.html | 4 ++--
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s03.html | 4 ++--
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s04.html | 4 ++--
sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html | 3 +--
sandbox/big_number/libs/multiprecision/doc/html/index.html | 2 +-
sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk | 2 +-
sandbox/big_number/libs/multiprecision/performance/sf_performance.cpp | 13 +++++++++++++
8 files changed, 24 insertions(+), 12 deletions(-)
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s01.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s01.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s01.html 2012-06-05 06:40:56 EDT (Tue, 05 Jun 2012)
@@ -13,9 +13,9 @@
<div class="spirit-nav">
<a accesskey="p" href="../indexes.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../indexes.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="s02.html"><img src="../../images/next.png" alt="Next"></a>
</div>
-<div class="section id919617">
+<div class="section id920740">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id919617"></a>Function Index</h3></div></div></div>
+<a name="id920740"></a>Function Index</h3></div></div></div>
<p><a class="link" href="s01.html#idx_id_0">A</a> <a class="link" href="s01.html#idx_id_1">B</a> <a class="link" href="s01.html#idx_id_2">C</a> <a class="link" href="s01.html#idx_id_3">D</a> <a class="link" href="s01.html#idx_id_4">E</a> <a class="link" href="s01.html#idx_id_5">F</a> <a class="link" href="s01.html#idx_id_7">I</a> <a class="link" href="s01.html#idx_id_8">L</a> <a class="link" href="s01.html#idx_id_9">M</a> <a class="link" href="s01.html#idx_id_12">P</a> <a class="link" href="s01.html#idx_id_13">R</a> <a class="link" href="s01.html#idx_id_14">S</a> <a class="link" href="s01.html#idx_id_15">T</a> <a class="link" href="s01.html#idx_id_16">Z</a></p>
<div class="variablelist"><dl>
<dt>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s02.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s02.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s02.html 2012-06-05 06:40:56 EDT (Tue, 05 Jun 2012)
@@ -13,9 +13,9 @@
<div class="spirit-nav">
<a accesskey="p" href="s01.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../indexes.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="s03.html"><img src="../../images/next.png" alt="Next"></a>
</div>
-<div class="section id920589">
+<div class="section id921712">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id920589"></a>Class Index</h3></div></div></div>
+<a name="id921712"></a>Class Index</h3></div></div></div>
<p><a class="link" href="s02.html#idx_id_19">C</a> <a class="link" href="s02.html#idx_id_23">G</a> <a class="link" href="s02.html#idx_id_26">M</a> <a class="link" href="s02.html#idx_id_27">N</a> <a class="link" href="s02.html#idx_id_32">T</a></p>
<div class="variablelist"><dl>
<dt>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s03.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s03.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s03.html 2012-06-05 06:40:56 EDT (Tue, 05 Jun 2012)
@@ -13,9 +13,9 @@
<div class="spirit-nav">
<a accesskey="p" href="s02.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../indexes.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="s04.html"><img src="../../images/next.png" alt="Next"></a>
</div>
-<div class="section id920822">
+<div class="section id921945">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id920822"></a>Typedef Index</h3></div></div></div>
+<a name="id921945"></a>Typedef Index</h3></div></div></div>
<p><a class="link" href="s03.html#idx_id_36">C</a> <a class="link" href="s03.html#idx_id_41">I</a> <a class="link" href="s03.html#idx_id_42">L</a> <a class="link" href="s03.html#idx_id_43">M</a> <a class="link" href="s03.html#idx_id_49">T</a></p>
<div class="variablelist"><dl>
<dt>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s04.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s04.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/indexes/s04.html 2012-06-05 06:40:56 EDT (Tue, 05 Jun 2012)
@@ -12,9 +12,9 @@
<div class="spirit-nav">
<a accesskey="p" href="s03.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../indexes.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a>
</div>
-<div class="section id921513">
+<div class="section id922636">
<div class="titlepage"><div><div><h3 class="title">
-<a name="id921513"></a>Index</h3></div></div></div>
+<a name="id922636"></a>Index</h3></div></div></div>
<p><a class="link" href="s04.html#idx_id_51">A</a> <a class="link" href="s04.html#idx_id_52">B</a> <a class="link" href="s04.html#idx_id_53">C</a> <a class="link" href="s04.html#idx_id_54">D</a> <a class="link" href="s04.html#idx_id_55">E</a> <a class="link" href="s04.html#idx_id_56">F</a> <a class="link" href="s04.html#idx_id_57">G</a> <a class="link" href="s04.html#idx_id_58">I</a> <a class="link" href="s04.html#idx_id_59">L</a> <a class="link" href="s04.html#idx_id_60">M</a> <a class="link" href="s04.html#idx_id_61">N</a> <a class="link" href="s04.html#idx_id_62">O</a> <a class="link" href="s04.html#idx_id_63">P</a> <a class="link" href="s04.html#idx_id_64">R</a> <a class="link" href="s04.html#idx_id_65">S</a> <a class="link" href="s04.html#idx_id_66">T</a> <a class="link" href="s04.html#idx_id_67">Z</a></p>
<div class="variablelist"><dl>
<dt>
Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html 2012-06-05 06:40:56 EDT (Tue, 05 Jun 2012)
@@ -1715,8 +1715,7 @@
<td>
<p>
<code class="computeroutput"><span class="identifier">eval_round</span><span class="special">(</span><span class="identifier">b</span><span class="special">,</span>
- <span class="identifier">cb</span><span class="special">,</span>
- <span class="identifier">cb2</span><span class="special">)</span></code>
+ <span class="identifier">cb</span><span class="special">)</span></code>
</p>
</td>
<td>
Modified: sandbox/big_number/libs/multiprecision/doc/html/index.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/index.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/index.html 2012-06-05 06:40:56 EDT (Tue, 05 Jun 2012)
@@ -118,7 +118,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: June 04, 2012 at 17:33:32 GMT</small></p></td>
+<td align="left"><p><small>Last revised: June 05, 2012 at 10:39:20 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk (original)
+++ sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk 2012-06-05 06:40:56 EDT (Tue, 05 Jun 2012)
@@ -1806,7 +1806,7 @@
[[`eval_fabs(b, cb)`][`void`][Set `b` to the absolute value of `cb`.]]
[[`eval_fpclassify(cb)`][`int`][Returns one of the same values returned by `std::fpclassify`. Only required when `B` is an floating-point type.]]
[[`eval_trunc(b, cb)`][`void`][Performs the equivalent operation to `std::trunc` on argument `cb` and stores the result in `b`. Only required when `B` is an floating-point type.]]
-[[`eval_round(b, cb, cb2)`][`void`][Performs the equivalent operation to `std::round` on argument `cb` and stores the result in `b`. Only required when `B` is an floating-point type.]]
+[[`eval_round(b, cb)`][`void`][Performs the equivalent operation to `std::round` on argument `cb` and stores the result in `b`. Only required when `B` is an floating-point type.]]
[[`eval_exp(b, cb)`][`void`][Performs the equivalent operation to `std::exp` on argument `cb` and stores the result in `b`. Only required when `B` is an floating-point type.]]
[[`eval_log(b, cb)`][`void`][Performs the equivalent operation to `std::log` on argument `cb` and stores the result in `b`. Only required when `B` is an floating-point type.]]
[[`eval_log10(b, cb)`][`void`][Performs the equivalent operation to `std::log10` on argument `cb` and stores the result in `b`. Only required when `B` is an floating-point type.]]
Added: sandbox/big_number/libs/multiprecision/performance/float_backend.hpp
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/multiprecision/performance/float_backend.hpp 2012-06-05 06:40:56 EDT (Tue, 05 Jun 2012)
@@ -0,0 +1,437 @@
+///////////////////////////////////////////////////////////////
+// Copyright 2012 John Maddock. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
+
+#ifndef BOOST_MATH_FLOAT_BACKEND_HPP
+#define BOOST_MATH_FLOAT_BACKEND_HPP
+
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <boost/cstdint.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/math/concepts/real_concept.hpp>
+#include <boost/multiprecision/mp_number.hpp>
+
+namespace boost{
+namespace multiprecision{
+namespace backends{
+
+template <class Arithmetic>
+struct float_backend
+{
+ typedef mpl::list<int, long long> signed_types;
+ typedef mpl::list<unsigned, unsigned long long> unsigned_types;
+ typedef mpl::list<double, long double> float_types;
+ typedef int exponent_type;
+
+ float_backend(){}
+ float_backend(const float_backend& o)
+ {
+ m_value = o.m_value;
+ }
+ float_backend(const Arithmetic& o) : m_value(o) {}
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ float_backend(float_backend&& o) : m_value(o.m_value) {}
+ float_backend(Arithmetic&& o) : m_value(o) {}
+#endif
+ float_backend& operator = (const float_backend& o)
+ {
+ m_value = o.m_value;
+ return *this;
+ }
+ float_backend& operator = (unsigned long long i)
+ {
+ m_value = i;
+ return *this;
+ }
+ float_backend& operator = (unsigned i)
+ {
+ m_value = i;
+ return *this;
+ }
+ float_backend& operator = (long long i)
+ {
+ m_value = i;
+ return *this;
+ }
+ float_backend& operator = (int i)
+ {
+ m_value = i;
+ return *this;
+ }
+ float_backend& operator = (long double d)
+ {
+ m_value = d;
+ return *this;
+ }
+ float_backend& operator = (double d)
+ {
+ m_value = d;
+ return *this;
+ }
+ float_backend& operator = (const char* s)
+ {
+ m_value = boost::lexical_cast<double>(s);
+ return *this;
+ }
+ void swap(float_backend& o)
+ {
+ std::swap(m_value, o.m_value);
+ }
+ std::string str(std::streamsize digits, std::ios_base::fmtflags f)const
+ {
+ std::stringstream ss;
+ ss.flags(f);
+ ss << std::setprecision(digits) << m_value;
+ return ss.str();
+ }
+ void negate()
+ {
+ m_value = -m_value;
+ }
+ int compare(const float_backend& o)const
+ {
+ return m_value > o.m_value ? 1 : (m_value < o.m_value ? -1 : 0);
+ }
+ int compare(long long i)const
+ {
+ return m_value > i ? 1 : (m_value < i ? -1 : 0);
+ }
+ int compare(int i)const
+ {
+ return m_value > i ? 1 : (m_value < i ? -1 : 0);
+ }
+ int compare(unsigned long long i)const
+ {
+ return m_value > i ? 1 : (m_value < i ? -1 : 0);
+ }
+ int compare(unsigned i)const
+ {
+ return m_value > i ? 1 : (m_value < i ? -1 : 0);
+ }
+ int compare(long double d)const
+ {
+ return m_value > d ? 1 : (m_value < d ? -1 : 0);
+ }
+ int compare(double d)const
+ {
+ return m_value > d ? 1 : (m_value < d ? -1 : 0);
+ }
+ Arithmetic& data() { return m_value; }
+ const Arithmetic& data()const { return m_value; }
+private:
+ Arithmetic m_value;
+};
+
+template <class Arithmetic>
+inline void eval_add(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ result.data() += o.data();
+}
+template <class Arithmetic>
+inline void eval_subtract(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ result.data() -= o.data();
+}
+template <class Arithmetic>
+inline void eval_multiply(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ result.data() *= o.data();
+}
+template <class Arithmetic>
+inline void eval_divide(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ result.data() /= o.data();
+}
+
+template <class Arithmetic, class A2>
+inline typename enable_if<is_arithmetic<A2> >::type eval_add(float_backend<Arithmetic>& result, const A2& o)
+{
+ result.data() += o;
+}
+template <class Arithmetic, class A2>
+inline typename enable_if<is_arithmetic<A2> >::type eval_subtract(float_backend<Arithmetic>& result, const A2& o)
+{
+ result.data() -= o;
+}
+template <class Arithmetic, class A2>
+inline typename enable_if<is_arithmetic<A2> >::type eval_multiply(float_backend<Arithmetic>& result, const A2& o)
+{
+ result.data() *= o;
+}
+template <class Arithmetic, class A2>
+inline typename enable_if<is_arithmetic<A2> >::type eval_divide(float_backend<Arithmetic>& result, const A2& o)
+{
+ result.data() /= o;
+}
+
+template <class Arithmetic>
+inline void eval_add(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& a, const float_backend<Arithmetic>& b)
+{
+ result.data() = a.data() + b.data();
+}
+template <class Arithmetic>
+inline void eval_subtract(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& a, const float_backend<Arithmetic>& b)
+{
+ result.data() = a.data() - b.data();
+}
+template <class Arithmetic>
+inline void eval_multiply(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& a, const float_backend<Arithmetic>& b)
+{
+ result.data() = a.data() * b.data();
+}
+template <class Arithmetic>
+inline void eval_divide(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& a, const float_backend<Arithmetic>& b)
+{
+ result.data() = a.data() / b.data();
+}
+
+template <class Arithmetic, class A2>
+inline typename enable_if<is_arithmetic<A2>>::type eval_add(float_backend<Arithmetic>& result, const A2& a, const float_backend<Arithmetic>& b)
+{
+ result.data() = a + b.data();
+}
+template <class Arithmetic, class A2>
+inline typename enable_if<is_arithmetic<A2>>::type eval_subtract(float_backend<Arithmetic>& result, const A2& a, const float_backend<Arithmetic>& b)
+{
+ result.data() = a - b.data();
+}
+template <class Arithmetic, class A2>
+inline typename enable_if<is_arithmetic<A2>>::type eval_multiply(float_backend<Arithmetic>& result, const A2& a, const float_backend<Arithmetic>& b)
+{
+ result.data() = a * b.data();
+}
+template <class Arithmetic, class A2>
+inline typename enable_if<is_arithmetic<A2>>::type eval_divide(float_backend<Arithmetic>& result, const A2& a, const float_backend<Arithmetic>& b)
+{
+ result.data() = a / b.data();
+}
+
+template <class Arithmetic>
+inline bool eval_is_zero(const float_backend<Arithmetic>& val)
+{
+ return val.data() == 0;
+}
+
+template <class Arithmetic>
+inline int eval_get_sign(const float_backend<Arithmetic>& val)
+{
+ return val.data() == 0 ? 0 : val.data() < 0 ? -1 : 1;
+}
+
+template <class Arithmetic>
+inline void eval_abs(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ result.data() = std::abs(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_fabs(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ result.data() = std::abs(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_floor(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = floor(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_ceil(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = ceil(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_sqrt(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = sqrt(o.data());
+}
+
+template <class Arithmetic>
+inline int eval_fpclassify(const float_backend<Arithmetic>& o)
+{
+ return (boost::math::fpclassify)(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_trunc(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = trunc(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_round(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = round(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_exp(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = exp(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_log(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = log(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_log10(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = log10(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_sin(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = sin(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_cos(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = cos(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_tan(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = tan(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_acos(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = acos(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_asin(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = asin(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_atan(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = atan(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_sinh(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = sinh(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_cosh(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = cosh(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_tanh(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& o)
+{
+ BOOST_MATH_STD_USING
+ result.data() = tanh(o.data());
+}
+
+template <class Arithmetic>
+inline void eval_fmod(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& a, const float_backend<Arithmetic>& b)
+{
+ BOOST_MATH_STD_USING
+ result.data() = fmod(a.data(), b.data());
+}
+
+template <class Arithmetic>
+inline void eval_pow(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& a, const float_backend<Arithmetic>& b)
+{
+ BOOST_MATH_STD_USING
+ result.data() = pow(a.data(), b.data());
+}
+
+template <class Arithmetic>
+inline void eval_atan2(float_backend<Arithmetic>& result, const float_backend<Arithmetic>& a, const float_backend<Arithmetic>& b)
+{
+ BOOST_MATH_STD_USING
+ result.data() = atan2(a.data(), b.data());
+}
+
+} // namespace backends
+
+using boost::multiprecision::backends::float_backend;
+
+}} // namespaces
+
+namespace boost{ namespace math{ namespace tools{
+
+template <>
+inline double real_cast<double, concepts::real_concept>(concepts::real_concept r)
+{
+ return static_cast<double>(r.value());
+}
+
+}}}
+
+
+namespace std{
+
+template <class Arithmetic, bool ExpressionTemplates>
+class numeric_limits<boost::multiprecision::mp_number<boost::multiprecision::float_backend<Arithmetic>, ExpressionTemplates > > : public std::numeric_limits<Arithmetic>
+{
+ typedef std::numeric_limits<Arithmetic> base_type;
+ typedef boost::multiprecision::mp_number<boost::multiprecision::float_backend<Arithmetic>, ExpressionTemplates> number_type;
+public:
+ BOOST_STATIC_CONSTEXPR number_type (min)() BOOST_MP_NOEXCEPT { return (base_type::min)(); }
+ BOOST_STATIC_CONSTEXPR number_type (max)() BOOST_MP_NOEXCEPT { return (base_type::max)(); }
+ BOOST_STATIC_CONSTEXPR number_type lowest() BOOST_MP_NOEXCEPT { return -(max)(); }
+ BOOST_STATIC_CONSTEXPR number_type epsilon() BOOST_MP_NOEXCEPT { return base_type::epsilon(); }
+ BOOST_STATIC_CONSTEXPR number_type round_error() BOOST_MP_NOEXCEPT { return epsilon() / 2; }
+ BOOST_STATIC_CONSTEXPR number_type infinity() BOOST_MP_NOEXCEPT { return base_type::infinity(); }
+ BOOST_STATIC_CONSTEXPR number_type quiet_NaN() BOOST_MP_NOEXCEPT { return base_type::quiet_NaN(); }
+ BOOST_STATIC_CONSTEXPR number_type signaling_NaN() BOOST_MP_NOEXCEPT { return base_type::signaling_NaN(); }
+ BOOST_STATIC_CONSTEXPR number_type denorm_min() BOOST_MP_NOEXCEPT { return base_type::denorm_min(); }
+};
+
+template<>
+class numeric_limits<boost::math::concepts::real_concept> : public std::numeric_limits<long double>
+{
+ typedef std::numeric_limits<long double> base_type;
+ typedef boost::math::concepts::real_concept number_type;
+public:
+ BOOST_STATIC_CONSTEXPR number_type (min)() BOOST_MP_NOEXCEPT { return (base_type::min)(); }
+ BOOST_STATIC_CONSTEXPR number_type (max)() BOOST_MP_NOEXCEPT { return (base_type::max)(); }
+ BOOST_STATIC_CONSTEXPR number_type lowest() BOOST_MP_NOEXCEPT { return -(max)(); }
+ BOOST_STATIC_CONSTEXPR number_type epsilon() BOOST_MP_NOEXCEPT { return base_type::epsilon(); }
+ BOOST_STATIC_CONSTEXPR number_type round_error() BOOST_MP_NOEXCEPT { return epsilon() / 2; }
+ BOOST_STATIC_CONSTEXPR number_type infinity() BOOST_MP_NOEXCEPT { return base_type::infinity(); }
+ BOOST_STATIC_CONSTEXPR number_type quiet_NaN() BOOST_MP_NOEXCEPT { return base_type::quiet_NaN(); }
+ BOOST_STATIC_CONSTEXPR number_type signaling_NaN() BOOST_MP_NOEXCEPT { return base_type::signaling_NaN(); }
+ BOOST_STATIC_CONSTEXPR number_type denorm_min() BOOST_MP_NOEXCEPT { return base_type::denorm_min(); }
+};
+
+}
+
+#endif
Modified: sandbox/big_number/libs/multiprecision/performance/sf_performance.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/performance/sf_performance.cpp (original)
+++ sandbox/big_number/libs/multiprecision/performance/sf_performance.cpp 2012-06-05 06:40:56 EDT (Tue, 05 Jun 2012)
@@ -14,6 +14,9 @@
# define TEST_MPREAL
#endif
+#ifdef TEST_FLOAT
+#include "float_backend.hpp"
+#endif
#ifdef TEST_MPFR_CLASS
#include <boost/math/bindings/mpfr.hpp>
#endif
@@ -250,6 +253,16 @@
#endif
//
+ // Comparison for builtin floats:
+ //
+#ifdef TEST_FLOAT
+ time_proc("double", test_bessel<double>);
+ time_proc("real_concept", test_bessel<boost::math::concepts::real_concept>);
+ time_proc("float_backend<double>", test_bessel<mp_number<float_backend<double> > >);
+ time_proc("float_backend<double> - no expression templates", test_bessel<mp_number<float_backend<double>, false> >);
+#endif
+
+ //
// 50 digits first:
//
std::cout << "Testing Bessel Functions at 50 digits....." << std::endl;
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