• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Using Boost.Math with High-Precision Floating-Point Libraries</title>
5<link rel="stylesheet" href="../math.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../index.html" title="Math Toolkit 2.12.0">
8<link rel="up" href="../using_udt.html" title="Chapter 20. Use with User-Defined Floating-Point Types - Boost.Multiprecision and others">
9<link rel="prev" href="../using_udt.html" title="Chapter 20. Use with User-Defined Floating-Point Types - Boost.Multiprecision and others">
10<link rel="next" href="high_precision/why_high_precision.html" title="Why use a high-precision library rather than built-in floating-point types?">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="../using_udt.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../using_udt.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="high_precision/why_high_precision.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h2 class="title" style="clear: both">
27<a name="math_toolkit.high_precision"></a><a class="link" href="high_precision.html" title="Using Boost.Math with High-Precision Floating-Point Libraries">Using Boost.Math with High-Precision
28    Floating-Point Libraries</a>
29</h2></div></div></div>
30<div class="toc"><dl class="toc">
31<dt><span class="section"><a href="high_precision/why_high_precision.html">Why use
32      a high-precision library rather than built-in floating-point types?</a></span></dt>
33<dt><span class="section"><a href="high_precision/use_multiprecision.html">Using
34      Boost.Multiprecision</a></span></dt>
35<dt><span class="section"><a href="high_precision/float128.html">Using with GCC's
36      __float128 datatype</a></span></dt>
37<dt><span class="section"><a href="high_precision/use_mpfr.html">Using With MPFR
38      or GMP - High-Precision Floating-Point Library</a></span></dt>
39<dt><span class="section"><a href="high_precision/e_float.html">Using e_float Library</a></span></dt>
40<dt><span class="section"><a href="high_precision/use_ntl.html">Using NTL Library</a></span></dt>
41<dt><span class="section"><a href="high_precision/using_test.html">Using without
42      expression templates for Boost.Test and others</a></span></dt>
43</dl></div>
44<p>
45      The special functions, distributions, constants and tools in this library can
46      be used with a number of high-precision libraries, including:
47    </p>
48<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
49<li class="listitem">
50          <a href="../../../../../libs/multiprecision/doc/html/index.html" target="_top">Boost.Multiprecision</a>
51        </li>
52<li class="listitem">
53          <a href="http://calgo.acm.org/910.zip" target="_top">e_float (TOMS Algorithm 910)</a>
54        </li>
55<li class="listitem">
56          <a href="http://www.shoup.net/ntl/" target="_top">NTL A Library for doing Number Theory</a>
57        </li>
58<li class="listitem">
59          <a href="http://gmplib.org/" target="_top">GNU Multiple Precision Arithmetic Library</a>
60        </li>
61<li class="listitem">
62          <a href="http://www.mpfr.org/" target="_top">GNU MPFR library</a>
63        </li>
64<li class="listitem">
65          <a href="https://gcc.gnu.org/onlinedocs/gcc-9.1.0/libquadmath/index.html" target="_top">GCC
66          128-bit floating-point type</a>
67        </li>
68<li class="listitem">
69          Intel _Quad type
70        </li>
71</ul></div>
72<p>
73      The last four have some license restrictions; only <a href="../../../../../libs/multiprecision/doc/html/index.html" target="_top">Boost.Multiprecision</a>
74      when using the <code class="computeroutput"><span class="identifier">cpp_float</span></code> backend
75      can provide an unrestricted <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">Boost</a>
76      license.
77    </p>
78<p>
79      At present, the price of a free license is slightly lower speed.
80    </p>
81<p>
82      Of course, the main cost of higher precision is very much decreased (usually
83      at least hundred-fold) computation speed, and big increases in memory use.
84    </p>
85<p>
86      Some libraries offer true <a href="http://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic" target="_top">arbitrary-precision
87      arithmetic</a> where the precision is limited only by available memory
88      and compute time, but most are used at some arbitrarily-fixed precision, say
89      100 decimal digits, like <a href="../../../../../libs/multiprecision/doc/html/index.html" target="_top">Boost.Multiprecision</a>
90      <code class="computeroutput"><span class="identifier">cpp_dec_float_100</span></code>.
91    </p>
92<p>
93      <a href="../../../../../libs/multiprecision/doc/html/index.html" target="_top">Boost.Multiprecision</a>
94      can operate in both ways, but the most popular choice is likely to be about
95      a hundred decimal digits, though examples of computing about a million digits
96      have been demonstrated.
97    </p>
98</div>
99<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
100<td align="left"></td>
101<td align="right"><div class="copyright-footer">Copyright © 2006-2019 Nikhar
102      Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
103      Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan
104      Råde, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg,
105      Daryle Walker and Xiaogang Zhang<p>
106        Distributed under the Boost Software License, Version 1.0. (See accompanying
107        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
108      </p>
109</div></td>
110</tr></table>
111<hr>
112<div class="spirit-nav">
113<a accesskey="p" href="../using_udt.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../using_udt.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="high_precision/why_high_precision.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
114</div>
115</body>
116</html>
117