Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2007-12-14 13:54:31


Author: johnmaddock
Date: 2007-12-14 13:54:30 EST (Fri, 14 Dec 2007)
New Revision: 42042
URL: http://svn.boost.org/trac/boost/changeset/42042

Log:
Added zeta docs.
Added:
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta1.mml (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta1.png (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta1.svg (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta2.mml (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta2.png (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta2.svg (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta3.mml (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta3.png (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta3.svg (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta4.mml (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta4.png (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta4.svg (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta5.mml (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta5.png (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta5.svg (contents, props changed)
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/zeta.qbk (contents, props changed)
Text files modified:
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/issues.qbk | 49 ++++++++++++++++++++++++++++++++++++++++
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk | 4 +++
   2 files changed, 53 insertions(+), 0 deletions(-)

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta1.mml
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta1.mml 2007-12-14 13:54:30 EST (Fri, 14 Dec 2007)
@@ -0,0 +1,29 @@
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <mrow>
+ <mi>&#x03B6;</mi>
+ <mfenced>
+ <mrow>
+ <mi>s</mi>
+ </mrow>
+ </mfenced>
+ <mspace width="1em"/>
+ <mo>=</mo>
+ <mspace width="1em"/>
+ <munderover>
+ <mo>&#x2211;</mo>
+ <mrow>
+ <mi>k</mi>
+ <mo>=</mo>
+ <mn>1</mn>
+ </mrow>
+ <mi>&#x221E;</mi>
+ </munderover>
+ <mfrac>
+ <mn>1</mn>
+ <msup>
+ <mi>k</mi>
+ <mi>s</mi>
+ </msup>
+ </mfrac>
+ </mrow>
+</math>
\ No newline at end of file

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta1.png
==============================================================================
Binary file. No diff available.

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta1.svg
==============================================================================
Binary file. No diff available.

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta2.mml
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta2.mml 2007-12-14 13:54:30 EST (Fri, 14 Dec 2007)
@@ -0,0 +1,95 @@
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <mrow>
+ <mi>&#x03B6;</mi>
+ <mfenced>
+ <mrow>
+ <mi>s</mi>
+ </mrow>
+ </mfenced>
+ <mspace width="1em"/>
+ <mo>=</mo>
+ <mspace width="1em"/>
+ <mfrac>
+ <mn>1</mn>
+ <mrow>
+ <mn>1</mn>
+ <mo>&#x2212;</mo>
+ <msup>
+ <mn>2</mn>
+ <mrow>
+ <mn>1</mn>
+ <mo>&#x2212;</mo>
+ <mi>s</mi>
+ </mrow>
+ </msup>
+ </mrow>
+ </mfrac>
+ <munderover>
+ <mo>&#x2211;</mo>
+ <mrow>
+ <mi>n</mi>
+ <mo>=</mo>
+ <mn>0</mn>
+ </mrow>
+ <mi>&#x221E;</mi>
+ </munderover>
+ <mfrac>
+ <mn>1</mn>
+ <msup>
+ <mn>2</mn>
+ <mrow>
+ <mi>n</mi>
+ <mo>+</mo>
+ <mn>1</mn>
+ </mrow>
+ </msup>
+ </mfrac>
+ <munderover>
+ <mo>&#x2211;</mo>
+ <mrow>
+ <mi>k</mi>
+ <mo>=</mo>
+ <mn>0</mn>
+ </mrow>
+ <mi>n</mi>
+ </munderover>
+ <msup>
+ <mfenced>
+ <mrow>
+ <mo>&#x2212;</mo>
+ <mn>1</mn>
+ </mrow>
+ </mfenced>
+ <mi>k</mi>
+ </msup>
+ <mfenced>
+ <mrow>
+ <mtable>
+ <mtr>
+ <mtd>
+ <mi>n</mi>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mi>k</mi>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mrow>
+ </mfenced>
+ <msup>
+ <mfenced>
+ <mrow>
+ <mi>k</mi>
+ <mo>+</mo>
+ <mn>1</mn>
+ </mrow>
+ </mfenced>
+ <mrow>
+ <mo>&#x2212;</mo>
+ <mi>s</mi>
+ </mrow>
+ </msup>
+ </mrow>
+</math>
\ No newline at end of file

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta2.png
==============================================================================
Binary file. No diff available.

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta2.svg
==============================================================================
Binary file. No diff available.

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta3.mml
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta3.mml 2007-12-14 13:54:30 EST (Fri, 14 Dec 2007)
@@ -0,0 +1,54 @@
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <mrow>
+ <mi>&#x03B6;</mi>
+ <mfenced>
+ <mrow>
+ <mn>1</mn>
+ <mo>&#x2212;</mo>
+ <mi>s</mi>
+ </mrow>
+ </mfenced>
+ <mspace width="1em"/>
+ <mo>=</mo>
+ <mspace width="1em"/>
+ <mn>2</mn>
+ <mi>sin</mi>
+ <mfenced>
+ <mrow>
+ <mi>&#x03C0;</mi>
+ <mfrac>
+ <mrow>
+ <mn>1</mn>
+ <mo>&#x2212;</mo>
+ <mi>s</mi>
+ </mrow>
+ <mn>2</mn>
+ </mfrac>
+ </mrow>
+ </mfenced>
+ <mfenced>
+ <mrow>
+ <mn>2</mn>
+ <msup>
+ <mi>&#x03C0;</mi>
+ <mrow>
+ <mo>&#x2212;</mo>
+ <mi>s</mi>
+ </mrow>
+ </msup>
+ </mrow>
+ </mfenced>
+ <mi>&#x0393;</mi>
+ <mfenced>
+ <mrow>
+ <mi>s</mi>
+ </mrow>
+ </mfenced>
+ <mi>&#x03B6;</mi>
+ <mfenced>
+ <mrow>
+ <mi>s</mi>
+ </mrow>
+ </mfenced>
+ </mrow>
+</math>
\ No newline at end of file

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta3.png
==============================================================================
Binary file. No diff available.

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta3.svg
==============================================================================
Binary file. No diff available.

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta4.mml
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta4.mml 2007-12-14 13:54:30 EST (Fri, 14 Dec 2007)
@@ -0,0 +1,32 @@
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <mrow>
+ <mi>&#x03C2;</mi>
+ <mfenced>
+ <mrow>
+ <mi>s</mi>
+ </mrow>
+ </mfenced>
+ <mo>=</mo>
+ <mfrac>
+ <mrow>
+ <mi>C</mi>
+ <mo>+</mo>
+ <mi>R</mi>
+ <mfenced>
+ <mrow>
+ <mn>1</mn>
+ <mo>&#x2212;</mo>
+ <mi>s</mi>
+ </mrow>
+ </mfenced>
+ <mo>&#x2212;</mo>
+ <mi>s</mi>
+ </mrow>
+ <mrow>
+ <mn>1</mn>
+ <mo>&#x2212;</mo>
+ <mi>s</mi>
+ </mrow>
+ </mfrac>
+ </mrow>
+</math>
\ No newline at end of file

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta4.png
==============================================================================
Binary file. No diff available.

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta4.svg
==============================================================================
Binary file. No diff available.

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta5.mml
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta5.mml 2007-12-14 13:54:30 EST (Fri, 14 Dec 2007)
@@ -0,0 +1,30 @@
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <mrow>
+ <mi>&#x03C2;</mi>
+ <mfenced>
+ <mrow>
+ <mi>s</mi>
+ </mrow>
+ </mfenced>
+ <mo>=</mo>
+ <mi>C</mi>
+ <mo>+</mo>
+ <mi>R</mi>
+ <mfenced>
+ <mrow>
+ <mi>s</mi>
+ <mo>&#x2212;</mo>
+ <mi>n</mi>
+ </mrow>
+ </mfenced>
+ <mo>+</mo>
+ <mfrac>
+ <mn>1</mn>
+ <mrow>
+ <mi>s</mi>
+ <mo>&#x2212;</mo>
+ <mn>1</mn>
+ </mrow>
+ </mfrac>
+ </mrow>
+</math>
\ No newline at end of file

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta5.png
==============================================================================
Binary file. No diff available.

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/equations/zeta5.svg
==============================================================================
Binary file. No diff available.

Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/issues.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/issues.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/issues.qbk 2007-12-14 13:54:30 EST (Fri, 14 Dec 2007)
@@ -80,6 +80,55 @@
 
 * Student's t Perhaps switch to normal distribution as a better approximation for very large degrees of freedom?
 
+[h4 Feature Requests]
+
+The following table lists distributions that are found in other packages
+but which are not yet present here, the more frequently the distribution
+is found, the higher the priority for implementing it:
+
+[table
+[[Distribution][R][Mathematica 6][NIST][Regress+][Matlab]]
+[[Non-central Chi Squared][X][X][-][-][X]]
+[[Non-central F][X][X][-][-][X]]
+[[Non-central T][X][X][-][-][X]]
+[[Logistic][X][X][-][X][X]]
+[[Log Logistic][-][-][-][-][X]]
+[[Hypergeometric][X][X][-][X][X]]
+[[Geometric][X][-][-][-][X]]
+[[Multinomial][X][-][-][-][X]]
+[[Tukey (Studentized range)][X][-][-][-][-]]
+[[Tukey Lambda][X][-][X][-][-]]
+[[Wilcoxon rank sum][X][-][-][-][-]]
+[[Wincoxon signed rank][X][-][-][-][-]]
+[[Non-central Beta][X][-][-][-][-]]
+[[Half Normal / Folded Normal][-][X][-][X][-]]
+[[Inverse Gausian / Inverse Normal][-][X][-][X][X]]
+[[Laplace][-][X][-][-][-]]
+[[Maxwell][-][X][-][-][-]]
+[[Chi][-][X][-][X][-]]
+[[Gumbel][-][X][-][X][-]]
+[[Geometric][-][X][-][-][-]]
+[[Beta-Binomial][-][X][-][-][-]]
+[[Beta-negative Binomial][-][X][-][-][-]]
+[[Discrete Uniform][-][X][-][-][X]]
+[[Zipf][-][X][-][-][-]]
+[[Log Series][-][X][-][X][-]]
+[[Birnbaum-Saunders / Fatigue Life][-][-][X][-][-]]
+[[Double Exponential][-][-][X][-][-]]
+[[Power Normal][-][-][X][-][-]]
+[[Power Lognormal][-][-][X][-][-]]
+[[Cosine][-][-][-][X][-]]
+[[Double Gamma][-][-][-][X][-]]
+[[Double Weibul][-][-][-][X][-]]
+[[Hyperbolic Secant][-][-][-][X][-]]
+[[Laplace][-][-][-][X][-]]
+[[Semicircular][-][-][-][X][-]]
+[[Bradford][-][-][-][X][-]]
+[[Birr / Fisk][-][-][-][X][-]]
+[[Nakagami (generalised Chi)][-][-][-][X][X]]
+[[Reciprocal][-][-][-][X][-]]
+]
+
 [endsect][/section:issues Known Issues, and Todo List]
 
 [/

Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk 2007-12-14 13:54:30 EST (Fri, 14 Dec 2007)
@@ -343,6 +343,10 @@
 [include ellint_legendre.qbk]
 [endsect] [/section:ellint Elliptic Integrals]
 
+[section:zetas Zeta Functions]
+[include zeta.qbk]
+[endsect]
+
 [include powers.qbk]
 [include sinc.qbk]
 [include inv_hyper.qbk]

Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/zeta.qbk
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/zeta.qbk 2007-12-14 13:54:30 EST (Fri, 14 Dec 2007)
@@ -0,0 +1,129 @@
+[section:zeta Riemann Zeta Function]
+
+[h4 Synopsis]
+
+``
+#include <boost/math/special_functions/zeta.hpp>
+``
+
+ namespace boost{ namespace math{
+
+ template <class T>
+ ``__sf_result`` zeta(T z);
+
+ template <class T, class ``__Policy``>
+ ``__sf_result`` zeta(T z, const ``__Policy``&);
+
+ }} // namespaces
+
+The return type of these functions is computed using the __arg_pomotion_rules:
+the return type is `double` if T is an integer type, and T otherwise.
+
+[optional_policy]
+
+[h4 Description]
+
+ template <class T>
+ ``__sf_result`` zeta(T z);
+
+ template <class T, class ``__Policy``>
+ ``__sf_result`` zeta(T z, const ``__Policy``&);
+
+Returns the [@http://mathworld.wolfram.com/RiemannZetaFunction.html zeta function]
+of z:
+
+[equation zeta1]
+
+[h4 Accuracy]
+
+The following table shows the peak errors (in units of epsilon)
+found on various platforms with various floating point types,
+along with comparisons to the __gsl and __cephes libraries.
+Unless otherwise specified any floating point type that is narrower
+than the one shown will have __zero_error.
+
+[table Errors In the Function zeta(z)
+[[Significand Size] [Platform and Compiler] [z > 0][z < 0]]
+[[53] [Win32, Visual C++ 8] [Peak=0.99 Mean=0.1
+
+GSL Peak=8.7 Mean=1.0
+
+__cephes Peak=2.1 Mean=1.1
+] [Peak=7.1 Mean=3.0
+
+GSL Peak=137 Mean=14
+
+__cephes Peak=5084 Mean=470
+]]
+[[64] [RedHat Linux IA_EM64, gcc-4.1] [Peak=0.99 Mean=0.5] [Peak=570 Mean=60]]
+[[64] [Redhat Linux IA64, gcc-4.1] [Peak=0.99 Mean=0.5] [Peak=559 Mean=56]]
+[[113] [HPUX IA64, aCC A.06.06] [Peak=1.0 Mean=0.4] [Peak=1018 Mean=79]]
+]
+
+[h4 Testing]
+
+The tests for these functions come in two parts:
+basic sanity checks use spot values calculated using
+[@http://functions.wolfram.com/webMathematica/FunctionEvaluation.jsp?name=Zeta Mathworld's online evaluator],
+while accuracy checks use high-precision test values calculated at 1000-bit precision with
+[@http://shoup.net/ntl/doc/RR.txt NTL::RR] and this implementation.
+Note that the generic and type-specific
+versions of these functions use differing implementations internally, so this
+gives us reasonably independent test data. Using our test data to test other
+"known good" implementations also provides an additional sanity check.
+
+[h4 Implementation]
+
+All versions of these functions first use the usual reflection formulas
+to make their arguments positive:
+
+[equation zeta3]
+
+The generic versions of these functions are implemented using the series:
+
+[equation zeta1]
+
+for large z, and using the globally convergent series:
+
+[equation zeta2]
+
+In all other cases. The crossover point for these is chosen so that the first
+series is used only if it will converge reasonably quickly, the problem with this
+series is that convergence become slower the more terms you take, so we really do
+have to be certain of convergence before using this series, even though the
+alternative is often quite slow.
+
+When the significand (mantissa) size is recognised
+(currently for 53, 64 and 113-bit reals, plus single-precision 24-bit handled via promotion to double)
+then a series of rational approximations [jm_rationals] are used.
+
+For 0 < z < 1 the approximating form is:
+
+[equation zeta4]
+
+For a rational approximation R(1-z) and a constant C.
+
+For 1 < z < 4 the approximating form is:
+
+[equation zeta5]
+
+For a rational approximation R(n-z) and a constant C and integer n.
+
+For z > 4 the approximating form is:
+
+[zeta](z) = 1 + e[super R(z - n)]
+
+For a rational approximation R(z-n) and integer n, note that the accuracy
+required for R(z-n) is not full machine precision, but an absolute error
+of: [epsilon]/R(0). This saves us quite a few digits when dealing with large
+z, especially when [epsilon] is small.
+
+[endsect]
+[/ :error_function The Error Functions]
+
+[/
+ Copyright 2006 John Maddock and Paul A. Bristow.
+ 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_0.txt).
+]


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