22 set(arg, levelMax, intermediate);
29 if(intermediate == 0) {
32 m_intermediate = intermediate;
35 m_results = zeros(levelMax + 1);
36 double expmx = exp(-x);
37 if(arg < limitMin || arg > limitMax) {
39 m_results(levelMax) = calculateTaylorExpansion(arg, levelMax);
40 }
else if(arg > limitMax) {
41 m_results(levelMax) = calculateAsymptopticForm(arg, levelMax);
44 for(
int n = levelMax; n > 0; n--) {
45 double Fn = m_results(n);
46 m_results(n - 1) = (2*x*Fn + expmx) / (2*n - 1);
50 for(
int n = 0; n < levelMax + 1; n++) {
51 m_results(n) = m_intermediate->result(arg, n);
58 double dfac = doubleFactorial(2 * n - 1);
59 double result = dfac / pow(2, n + 1) * sqrt(M_PI / pow(arg, 2*n + 1));
68 for(
double i = n; i >= 1; i -= 2) {
79 double startPoint = 2;
80 for(
double i = startPoint; i <= n; i++) {
89 for(
int k = 0; k < 100; k++) {
90 result += pow(-arg, k) / (factorial(k) * (2 * n + 2 * k + 1));
100 double f = 1.0/arg * erf(arg) *sqrt(M_PI)/2.0;
107 return m_results(level);