Skip to content

Commit dbf0bd5

Browse files
committed
use more efficient implementations of Cl(n,x) for fixed n
1 parent fa3c363 commit dbf0bd5

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/cpp/Cl.cpp

+16-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
#include "Cl.hpp"
88
#include "Cl1.hpp"
9+
#include "Cl2.hpp"
10+
#include "Cl3.hpp"
11+
#include "Cl4.hpp"
12+
#include "Cl5.hpp"
13+
#include "Cl6.hpp"
914
#include <cmath>
1015
#include <limits>
1116

@@ -251,10 +256,18 @@ double Cl(int64_t n, double x)
251256

252257
if (n < 1) {
253258
return std::numeric_limits<double>::quiet_NaN();
254-
}
255-
256-
if (n == 1) {
259+
} else if (n == 1) {
257260
return Cl1(x);
261+
} else if (n == 2) {
262+
return Cl2(x);
263+
} else if (n == 3) {
264+
return Cl3(x);
265+
} else if (n == 4) {
266+
return Cl4(x);
267+
} else if (n == 5) {
268+
return Cl5(x);
269+
} else if (n == 6) {
270+
return Cl6(x);
258271
}
259272

260273
const auto sgn = range_reduce(n, x);

0 commit comments

Comments
 (0)