]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/math/doc/sf/trigamma.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / math / doc / sf / trigamma.qbk
CommitLineData
7c673cae
FG
1[section:trigamma Trigamma]
2
3[h4 Synopsis]
4
5``
6#include <boost/math/special_functions/trigamma.hpp>
7``
8
9 namespace boost{ namespace math{
10
11 template <class T>
12 ``__sf_result`` trigamma(T z);
13
14 template <class T, class ``__Policy``>
15 ``__sf_result`` trigamma(T z, const ``__Policy``&);
16
17 }} // namespaces
18
19[h4 Description]
20
21Returns the trigamma function of /x/. Trigamma is defined as the
22derivative of the digamma function:
23
24[equation trigamma1]
25
26[graph trigamma]
27
28[optional_policy]
29
30The return type of this function is computed using the __arg_promotion_rules:
31the result is of type `double` when T is an integer type, and type T otherwise.
32
33[h4 Accuracy]
34
35The following table shows the peak errors (in units of epsilon)
36found on various platforms with various floating point types.
37Unless otherwise specified any floating point type that is narrower
38than the one shown will have __zero_error.
39
40[table_trigamma]
41
42As shown above, error rates are generally very low for built in types.
43For multiprecision types, error rates are typically in the order of a
44few epsilon.
45
46[h4 Testing]
47
48Testing is against Mathematica generated spot values to 35 digit precision.
49
50[h4 Implementation]
51
52The arbitrary precision version of this function simply calls __polygamma.
53
54For built in fixed precision types, negative arguments are first made positive via:
55
56[equation trigamma2]
57
58Then arguments in the range \[0, 1) are shifted to >= 1 via:
59
60[equation trigamma3]
61
62Then evaluation is via one of a number of rational approximations, for small x these are
63of the form:
64
65[equation trigamma4]
66
67and for large x of the form:
68
69[equation trigamma5]
70
71[endsect][/section:digamma The Trigamma Function]
72
73[/
74 Copyright 2014 John Maddock and Paul A. Bristow.
75 Distributed under the Boost Software License, Version 1.0.
76 (See accompanying file LICENSE_1_0.txt or copy at
77 http://www.boost.org/LICENSE_1_0.txt).
78]
79