-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add polynomial fitting scheme for erfc integral rys roots Bug fixes of erfc integral rys roots
- Loading branch information
Showing
17 changed files
with
357,816 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// This function is implemented based on libslater library | ||
// https://github.com/nubakery/libslater | ||
|
||
#include <stdlib.h> | ||
#include <stdio.h> | ||
#include <math.h> | ||
#include "rys_roots.h" | ||
#include "erfc_roots_xw.dat" | ||
|
||
void _CINT_clenshaw_d1(double *rr, const double *x, double u, FINT nroot); | ||
void _CINT_clenshaw_dc(double *rr, const double *x, double u, FINT nroot); | ||
void _CINT_matmul_14_14(double *imc, double *im, FINT nroot); | ||
|
||
void CINTerfc_rys_polyfits(FINT nroots, double x, double lower, double* u, double* w) | ||
{ | ||
const double* dx = DATA_X + (nroots-1)*nroots/2 * 1960; | ||
const double* dw = DATA_W + (nroots-1)*nroots/2 * 1960; | ||
double ll, t, tt; | ||
FINT k, it; | ||
FINT offset; | ||
double im [14*nroots]; | ||
double imc[14*nroots]; | ||
|
||
t = x; | ||
if (t > 19682.99) t = 19682.99; | ||
if (t > 1.0) { | ||
tt = log(t) * 0.9102392266268373 + 1.0; // log(3)+1 | ||
} else { | ||
tt = sqrt(t); | ||
} | ||
|
||
it = (FINT)tt; | ||
tt = tt - it; | ||
tt = 2.0 * tt - 1.0; | ||
ll = 2.0 * lower - 1.0; | ||
|
||
offset = nroots * 196 * it; | ||
_CINT_clenshaw_dc(im, dx+offset, ll, nroots); | ||
_CINT_matmul_14_14(imc, im, nroots); | ||
_CINT_clenshaw_d1(u, imc, tt, nroots); | ||
_CINT_clenshaw_dc(im, dw+offset, ll, nroots); | ||
_CINT_matmul_14_14(imc, im, nroots); | ||
_CINT_clenshaw_d1(w, imc, tt, nroots); | ||
|
||
for (k = 0; k < nroots; k++) { | ||
u[k] = u[k] / (1 - u[k]); | ||
} | ||
} |
Oops, something went wrong.