lanczos.h
Go to the documentation of this file.
1 /* (C) Copyright John Maddock 2006.
2  * Use, modification and distribution are subject to the
3  * Boost Software License, Version 1.0. (See accompanying file
4  * LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
5  */
6 
7 /* Both lanczos.h and lanczos.c were formed from Boost's lanczos.hpp
8  *
9  * Scipy changes:
10  * - 06-22-2016: Removed all code not related to double precision and
11  * ported to c for use in Cephes. Note that the order of the
12  * coefficients is reversed to match the behavior of polevl.
13  */
14 
15 /*
16  * Optimal values for G for each N are taken from
17  * https://web.viu.ca/pughg/phdThesis/phdThesis.pdf,
18  * as are the theoretical error bounds.
19  *
20  * Constants calculated using the method described by Godfrey
21  * https://my.fit.edu/~gabdo/gamma.txt and elaborated by Toth at
22  * https://www.rskey.org/gamma.htm using NTL::RR at 1000 bit precision.
23  */
24 
25 /*
26  * Lanczos Coefficients for N=13 G=6.024680040776729583740234375
27  * Max experimental error (with arbitrary precision arithmetic) 1.196214e-17
28  * Generated with compiler: Microsoft Visual C++ version 8.0 on Win32 at Mar 23 2006
29  *
30  * Use for double precision.
31  */
32 
33 #ifndef LANCZOS_H
34 #define LANCZOS_H
35 
36 
37 static const double lanczos_num[13] = {
38  2.506628274631000270164908177133837338626,
39  210.8242777515793458725097339207133627117,
40  8071.672002365816210638002902272250613822,
41  186056.2653952234950402949897160456992822,
42  2876370.628935372441225409051620849613599,
43  31426415.58540019438061423162831820536287,
44  248874557.8620541565114603864132294232163,
45  1439720407.311721673663223072794912393972,
46  6039542586.35202800506429164430729792107,
47  17921034426.03720969991975575445893111267,
48  35711959237.35566804944018545154716670596,
49  42919803642.64909876895789904700198885093,
50  23531376880.41075968857200767445163675473
51 };
52 
53 static const double lanczos_denom[13] = {
54  1,
55  66,
56  1925,
57  32670,
58  357423,
59  2637558,
60  13339535,
61  45995730,
62  105258076,
63  150917976,
64  120543840,
65  39916800,
66  0
67 };
68 
69 static const double lanczos_sum_expg_scaled_num[13] = {
70  0.006061842346248906525783753964555936883222,
71  0.5098416655656676188125178644804694509993,
72  19.51992788247617482847860966235652136208,
73  449.9445569063168119446858607650988409623,
74  6955.999602515376140356310115515198987526,
75  75999.29304014542649875303443598909137092,
76  601859.6171681098786670226533699352302507,
77  3481712.15498064590882071018964774556468,
78  14605578.08768506808414169982791359218571,
79  43338889.32467613834773723740590533316085,
80  86363131.28813859145546927288977868422342,
81  103794043.1163445451906271053616070238554,
82  56906521.91347156388090791033559122686859
83 };
84 
85 static const double lanczos_sum_expg_scaled_denom[13] = {
86  1,
87  66,
88  1925,
89  32670,
90  357423,
91  2637558,
92  13339535,
93  45995730,
94  105258076,
95  150917976,
96  120543840,
97  39916800,
98  0
99 };
100 
101 static const double lanczos_sum_near_1_d[12] = {
102  0.3394643171893132535170101292240837927725e-9,
103  -0.2499505151487868335680273909354071938387e-8,
104  0.8690926181038057039526127422002498960172e-8,
105  -0.1933117898880828348692541394841204288047e-7,
106  0.3075580174791348492737947340039992829546e-7,
107  -0.2752907702903126466004207345038327818713e-7,
108  -0.1515973019871092388943437623825208095123e-5,
109  0.004785200610085071473880915854204301886437,
110  -0.1993758927614728757314233026257810172008,
111  1.483082862367253753040442933770164111678,
112  -3.327150580651624233553677113928873034916,
113  2.208709979316623790862569924861841433016
114 };
115 
116 static const double lanczos_sum_near_2_d[12] = {
117  0.1009141566987569892221439918230042368112e-8,
118  -0.7430396708998719707642735577238449585822e-8,
119  0.2583592566524439230844378948704262291927e-7,
120  -0.5746670642147041587497159649318454348117e-7,
121  0.9142922068165324132060550591210267992072e-7,
122  -0.8183698410724358930823737982119474130069e-7,
123  -0.4506604409707170077136555010018549819192e-5,
124  0.01422519127192419234315002746252160965831,
125  -0.5926941084905061794445733628891024027949,
126  4.408830289125943377923077727900630927902,
127  -9.8907772644920670589288081640128194231,
128  6.565936202082889535528455955485877361223
129 };
130 
131 static const double lanczos_g = 6.024680040776729583740234375;
132 
133 #endif
lanczos_num
static const double lanczos_num[13]
Definition: lanczos.h:37
lanczos_sum_expg_scaled_num
static const double lanczos_sum_expg_scaled_num[13]
Definition: lanczos.h:69
lanczos_denom
static const double lanczos_denom[13]
Definition: lanczos.h:53
lanczos_sum_expg_scaled_denom
static const double lanczos_sum_expg_scaled_denom[13]
Definition: lanczos.h:85
lanczos_sum_near_2_d
static const double lanczos_sum_near_2_d[12]
Definition: lanczos.h:116
lanczos_sum_near_1_d
static const double lanczos_sum_near_1_d[12]
Definition: lanczos.h:101
lanczos_g
static const double lanczos_g
Definition: lanczos.h:131


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:39