26 std::vector<double>& bl)
30 if (cl.size() != 2 *
m_Np) {
35 if (bl.size() !=
m_Np) {
40 for (
int i = 0; i < 2 *
m_Np; ++i) {
44 for (
int i = 0; i <
m_Np; ++i) {
77 for (
int l = 0; l <
m_Np; l++) {
78 x2R +=
m_bl[l] / (x * x +
m_cl[2 * l]);
80 x2R = x2R * (x * x +
m_cl[2 *
m_Np - 1]);
99 const double rk = sqrt(1.0 - 1.0 / (bmax * bmax));
100 const double emmc = 1.0 - rk * rk;
109 for (
int i_prec = 0; i_prec < Nprec + 1; i_prec++) {
112 for (
int i = 0; i < 20; i++) {
116 if (cn < 0.0)
goto succeeded;
132 const double FK = UK / (2.0 *
m_Np + 1.0);
134 for (
int l = 0; l < 2 *
m_Np; l++) {
137 m_cl[l] = sn * sn / (1.0 - sn * sn);
142 for (
int l = 0; l <
m_Np; l++) {
143 d0 = d0 * (1.0 +
m_cl[2 * l]) / (1.0 +
m_cl[2 * l + 1]);
146 for (
int l = 0; l <
m_Np; l++) {
148 for (
int i = 0; i <
m_Np; i++) {
155 const int Nj = 10000;
156 const double Dx = (bmax - 1.0) / Nj;
161 for (
int jx = 0; jx <= Nj; jx++) {
162 double x = 1.0 + Dx * jx;
163 double sgnx =
sign(x);
164 if (fabs(sgnx) > d1) d1 = sgnx;
165 if (fabs(sgnx) < d2) d2 = sgnx;
188 double dmax = d1 - 1.0;
189 if (dmax < 1.0 - d2) dmax = 1.0 - d2;
196 double& sn,
double& cn,
double& dn)
207 const double epsilon = DBL_EPSILON;
211 const double emmc1 = 1 - emmc;
213 if (abs(emmc1) > 1.0) {
217 }
else if (abs(emmc1) < 2.0 * epsilon) {
221 }
else if (abs(emmc1 - 1) < 2.0 * epsilon) {
232 nu[0] = sqrt(1.0 - emmc1);
234 while (abs(mu[n] - nu[n]) > epsilon * abs(mu[n] + nu[n]))
236 mu[n + 1] = 0.5 * (mu[n] + nu[n]);
237 nu[n + 1] = sqrt(mu[n] * nu[n]);
245 double sin_umu = sin(uu * mu[n]);
246 double cos_umu = cos(uu * mu[n]);
250 if (fabs(sin_umu) < fabs(cos_umu)) {
251 double cot = sin_umu / cos_umu;
252 double cs = mu[n] * cot;
258 double r = cs * cs / mu[n + 1];
260 dn = (r + nu[n]) / (r + mu[n]);
263 double sqrt_m1 = sqrt(1.0 - emmc1);
266 cn = dn * (cos_umu > 0 ? 1 : -1) / sqrt(1 + cs * cs);
267 sn = cn * cs / sqrt_m1;
269 double cot = cos_umu / sin_umu;
270 double cs = mu[n] * cot;
276 double r = cs * cs / mu[n + 1];
278 dn = (r + nu[n]) / (r + mu[n]);
281 sn = (sin_umu > 0 ? 1 : -1) / sqrt(1 + cs * cs);