]> www.ginac.de Git - cln.git/blob - src/float/transcendental/cl_LF_ratsumseries_stream_pqd.cc
More memory efficient Euler-Mascheroni constant:
[cln.git] / src / float / transcendental / cl_LF_ratsumseries_stream_pqd.cc
1 // eval_pqd_series().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cl_LF_tran.h"
8
9
10 // Implementation.
11
12 #include "cln/lfloat.h"
13 #include "cln/integer.h"
14 #include "cl_LF.h"
15
16 namespace cln {
17
18 const cl_LF eval_pqd_series (uintC N, cl_pqd_series_stream& args, uintC len)
19 {
20         if (N==0)
21                 return cl_I_to_LF(0,len);
22         var cl_pqd_series_result sums;
23         eval_pqd_series_aux(N,args,sums);
24         // Instead of computing  fsum = T/Q  and  gsum = V/(D*Q)
25         // and then dividing them, to compute  gsum/fsum, we save two
26         // divisions by computing  V/(D*T).
27         return
28           cl_I_to_LF(sums.V,len) / The(cl_LF)(sums.D * cl_I_to_LF(sums.T,len));
29 }
30
31 }  // namespace cln