]> www.ginac.de Git - cln.git/blob - src/float/transcendental/cl_LF_ratseries_.cc
Finalize CLN 1.3.7 release.
[cln.git] / src / float / transcendental / cl_LF_ratseries_.cc
1 // eval_rational_series().
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "float/transcendental/cl_LF_tran.h"
8
9
10 // Implementation.
11
12 #include "cln/lfloat.h"
13 #include "cln/integer.h"
14 #include "float/lfloat/cl_LF.h"
15
16 namespace cln {
17
18 // Subroutine.
19 // Evaluates S = sum(N1 <= n < N2, a(n)/b(n) * (p(N1)...p(n))/(q(N1)...q(n)))
20 // and returns P = p(N1)...p(N2-1), Q = q(N1)...q(N2-1), B = B(N1)...B(N2-1)
21 // and T = B*Q*S (all integers). On entry N1 < N2.
22 // P will not be computed if a NULL pointer is passed.
23
24 static inline void eval__series_aux (uintC N1, uintC N2,
25                                      const cl__series& args,
26                                      cl_I* T)
27 {
28         cl_unused args;
29         *T = N2-N1;
30 }
31
32 const cl_LF eval_rational_series (uintC N, const cl__series& args, uintC len)
33 {
34         if (N==0)
35                 return cl_I_to_LF(0,len);
36         var cl_I T;
37         eval__series_aux(0,N,args,&T);
38         return cl_I_to_LF(T,len);
39 }
40 // Bit complexity (if p(n), q(n), a(n), b(n) have length O(log(n))):
41 // O(log(N)^2*M(N)).
42
43 }  // namespace cln