|
5 #include "diffusionFactor2.h"
11 double diffusionFactor2( double x)
13 static const double a_m160[] = {
15 0.0052408158879836035,
16 0.00067603436947200957,
17 9.6906016427047165e-05,
18 1.4589693269296478e-05,
19 2.2599709015760758e-06,
20 3.5665284682141206e-07,
21 5.7029364769451708e-08,
22 9.2088036202491301e-09,
23 1.4983042248000036e-09,
24 2.4525808290580496e-10,
25 4.0345255474062071e-11,
26 6.6642115253560996e-12,
27 1.1046315810533649e-12,
28 1.8364675844364025e-13,
29 3.0610775248382879e-14,
30 5.1138925270347952e-15,
31 8.5606756200932375e-16,
32 1.4354550385902103e-16,
33 2.4088043958724545e-17,
34 3.9385015302212454e-18
36 static const double a_m80[] = {
39 0.00090927673972108591,
40 0.00012753758747126521,
41 1.8798771299551956e-05,
42 2.8520962036009132e-06,
43 4.4099489945542269e-07,
44 6.9109593230610286e-08,
45 1.0939649685577586e-08,
46 1.7452440700629315e-09,
47 2.8016949352042695e-10,
48 4.5207291357665451e-11,
49 7.3257761543250868e-12,
50 1.1914500075596096e-12,
51 1.9438149126458507e-13,
52 3.1799097292178623e-14,
54 8.5692233925781008e-16,
55 1.410682551675202e-16,
56 2.3241777374612997e-17,
57 3.7334187197300791e-18
59 static const double a_m40[] = {
61 0.0098993381250291525,
63 0.00016990303381926204,
64 2.4711138774925709e-05,
65 3.7023702466966373e-06,
66 5.6570403392577033e-07,
67 8.7655090280002247e-08,
68 1.3725736055262137e-08,
69 2.1670407838754021e-09,
70 3.4441010877238304e-10,
71 5.503729028989188e-11,
72 8.8355137250870296e-12,
73 1.4239951345647648e-12,
74 2.3028067267343693e-13,
75 3.7350324223653444e-14,
76 6.0739269297352238e-15,
77 9.9008600229174862e-16,
78 1.6170036436654494e-16,
79 2.6440657802272236e-17,
80 4.2240524707015702e-18
82 static const double a_m20[] = {
85 0.0016098032418279938,
86 0.0002174058941277162,
87 3.0949072035199655e-05,
88 4.5456853410547137e-06,
89 6.817555154282486e-07,
90 1.0380180476908638e-07,
91 1.598661375927885e-08,
92 2.4844869252713606e-09,
93 3.8896562707642755e-10,
94 6.1269379308596461e-11,
95 9.7012709313062235e-12,
96 1.5429541447780714e-12,
97 2.4635886347221512e-13,
98 3.9470588217430402e-14,
99 6.3431632089533856e-15,
100 1.0222140426509087e-15,
101 1.6510721155020624e-16,
102 2.6702915336703069e-17,
103 4.2228625910851895e-18
105 static const double a_m9[] = {
107 0.020230500432115689,
108 0.0026841163757812584,
109 0.000400018150379431,
110 6.309982686849994e-05,
111 1.0302721242097596e-05,
112 1.7222546669302032e-06,
113 2.9292305311565961e-07,
114 5.0491094893621118e-08,
115 8.7969204438940848e-09,
116 1.5462655991544518e-09,
117 2.738236970764213e-10,
118 4.8801192788924355e-11,
119 8.7458325364765392e-12,
120 1.5750490556619191e-12,
121 2.8488758332022055e-13,
122 5.1730233646619079e-14,
123 9.4263847564666446e-15,
124 1.7230889540925401e-15,
125 3.1555171809480902e-16,
126 5.6096572002517297e-17
128 static const double a_m4[] = {
130 0.026057727371401426,
131 0.0032444926850706221,
132 0.00045948600696913881,
133 6.9496192939853222e-05,
134 1.0955503986269055e-05,
135 1.7780828437199838e-06,
136 2.949830852521079e-07,
137 4.9791351199250328e-08,
138 8.5237875106074325e-09,
139 1.4764707938413207e-09,
140 2.5832734813754341e-10,
141 4.559091982556144e-11,
142 8.1073373803106564e-12,
143 1.451402124984054e-12,
144 2.6139121010652892e-13,
145 4.73285945069507e-14,
146 8.6112199314614046e-15,
147 1.5735626312627608e-15,
148 2.8836567129895304e-16,
149 5.1341893725263162e-17
151 static const double a_001[] = {
153 0.025667470909059423,
154 0.0024591308682437364,
155 0.00027403764849678023,
156 3.3136150434335862e-05,
157 4.2266141140533153e-06,
158 5.6029476765066014e-07,
159 7.6496075117207105e-08,
160 1.0691490149984854e-08,
161 1.523193162245219e-09,
162 2.2050157405036199e-10,
163 3.2355844878476651e-11,
164 4.8033934459803503e-12,
165 7.2033066644637672e-13,
166 1.0898340864848178e-13,
167 1.6618152037786782e-14,
168 2.5516917551314589e-15,
169 3.9436143824304815e-16,
170 6.1212893013346769e-17,
171 9.5198436290933311e-18,
172 1.4732726395909797e-18
174 static const double a_01[] = {
176 0.026550990939845882,
177 0.0022316852768348933,
178 0.00022589510019385264,
179 2.5417645370067592e-05,
180 3.0698601195676094e-06,
181 3.9028809370426237e-07,
182 5.1592053940669445e-08,
183 7.0318076195644763e-09,
184 9.8227275994005179e-10,
185 1.4000668464021816e-10,
186 2.0293168920651209e-11,
187 2.9832923150793548e-12,
188 4.4390055092774891e-13,
189 6.6741506423884432e-14,
190 1.0125993313317228e-14,
191 1.5485891958647422e-15,
192 2.3864645069121559e-16,
193 3.6898045899269329e-17,
194 5.7191664598610359e-18,
195 9.0253377275058221e-19
197 static const double a_03[] = {
199 0.023439827535842644,
200 0.0015865814867846795,
201 0.00013630377416242785,
202 1.3469276418857162e-05,
203 1.4606555057838224e-06,
204 1.6914720156044868e-07,
205 2.0557671755005003e-08,
206 2.5920464655707826e-09,
207 3.3633544080523081e-10,
208 4.4653353036645457e-11,
209 6.0400254998947521e-12,
210 8.2972326202977265e-13,
211 1.154690027869403e-13,
212 1.6247759534536112e-14,
213 2.3080560383715018e-15,
214 3.305887309932944e-16,
215 4.7907538138267221e-17,
216 6.8349911957107006e-18,
217 9.2221720504868209e-19,
218 1.6085559017381665e-19
220 static const double a_06[] = {
222 0.026059013245511079,
223 -0.0002864235290850683,
224 0.00012237029300851102,
225 -7.0224378260013625e-06,
226 1.5905262620054674e-06,
227 -1.4930143886968221e-07,
228 2.8226054854609916e-08,
229 -3.328856376657302e-09,
230 5.8085035152287293e-10,
231 -7.7509041182665165e-11,
232 1.3007553389692023e-11,
233 -1.8661611001232423e-12,
234 3.0731892699252263e-13,
235 -4.6112636278849983e-14,
236 7.5299944747619651e-15,
237 -1.1630752991000809e-15,
238 1.8961405279899465e-16,
239 -2.9954957165528079e-17,
240 4.7469339760220999e-18,
241 -7.5942553956685555e-19
243 static const double a_08[] = {
245 0.018567733719387337,
246 0.00042592333826135716,
247 5.3990025316010915e-05,
248 4.3724286495273355e-06,
249 5.5705473207608488e-07,
250 6.539057613016484e-08,
251 8.7200163110557916e-09,
252 1.1682823821158203e-09,
253 1.636448568110036e-10,
254 2.3291521608022997e-11,
255 3.3865645154038974e-12,
256 4.9918820162545008e-13,
257 7.455349349405021e-14,
258 1.1250578789935639e-14,
259 1.7134627876611151e-15,
260 2.6308036643673566e-16,
261 4.090604446606768e-17,
262 6.2393253592796771e-18,
263 9.076966402386084e-19,
264 1.2729695150164627e-19
266 static const double a_09[] = {
268 0.011606122045773676,
269 0.00035382736799969433,
270 3.012684887954366e-05,
271 2.9397219654356154e-06,
272 3.3575439242470255e-07,
273 4.1375904917077875e-08,
274 5.3890684095233641e-09,
275 7.2970735788821398e-10,
276 1.0175269943753691e-10,
277 1.4516987614077291e-11,
278 2.1094516417608354e-12,
279 3.1116140789980548e-13,
280 4.6477701348211444e-14,
281 7.0163459512457254e-15,
282 1.0688336066905224e-15,
283 1.6414562748056135e-16,
284 2.5650416397386227e-17,
285 3.7985797543152851e-18,
286 5.040249385185589e-19,
287 8.6155351206437401e-20
289 static const double a_095[] = {
291 0.007480253686070166,
292 0.00023685523641974401,
293 1.8559830233775195e-05,
294 1.8375929615348941e-06,
295 2.0900558506730081e-07,
296 2.5786128743067678e-08,
297 3.3597953874739569e-09,
298 4.5518527834562034e-10,
299 6.3503259789894595e-11,
300 9.0640125845768299e-12,
301 1.3176135039396327e-12,
302 1.9442927086041339e-13,
303 2.905118946744786e-14,
304 4.3868910860096161e-15,
305 6.6847388446404177e-16,
306 1.0268685290309733e-16,
307 1.6142995918185957e-17,
308 2.2877956556316148e-18,
309 3.284874439256677e-19,
310 6.1631730638312899e-20,
312 static const double a_098[] = {
314 0.0059759053641499169,
315 0.0002439042351159064,
316 2.4342790265704914e-05,
317 3.1670778786592217e-06,
318 4.7262157934345584e-07,
319 7.6542449086696733e-08,
320 1.3091357122618394e-08,
321 2.3281213799761949e-09,
322 4.2632939718401429e-10,
323 7.9870973243087215e-11,
324 1.5239290024792436e-11,
325 2.9514604477765125e-12,
326 5.7879924914578889e-13,
327 1.1471160754501311e-13,
328 2.2941510164376882e-14,
329 4.6243920254769254e-15,
330 9.3884809194448653e-16,
331 1.915352848629764e-16,
332 3.913969842672671e-17,
333 7.7262311958312254e-18
335 static const double a_0992[] = {
337 0.0033270028409703319,
338 0.00013195084631676041,
339 1.306268834728929e-05,
340 1.7028554762349209e-06,
341 2.5444557219946899e-07,
342 4.1248103032871373e-08,
343 7.0599914091042044e-09,
344 1.2562440924468296e-09,
345 2.3015181121949108e-10,
346 4.3134409001373342e-11,
347 8.2326416940641698e-12,
348 1.5948908008379551e-12,
349 3.1284246078681052e-13,
350 6.2014919953991073e-14,
351 1.2404837202083042e-14,
352 2.5009175348204652e-15,
353 5.0791515917078665e-16,
354 1.0354453426454569e-16,
355 2.114065164659533e-17,
356 4.1964432301113054e-18
358 static const double a_0997[] = {
360 0.0019275134609139084,
361 7.954094205087676e-05,
362 8.4007488344470155e-06,
363 1.1708253340623425e-06,
364 1.8694426948753732e-07,
365 3.237527785670156e-08,
366 5.9189494781715684e-09,
367 1.1248855336792873e-09,
368 2.2009914017580867e-10,
369 4.4053532061214941e-11,
370 8.9791854920333388e-12,
371 1.8576352556273172e-12,
372 3.8911676511967414e-13,
373 8.2370166511819811e-14,
374 1.759455160104699e-14,
375 3.7878100127352627e-15,
376 8.2135542580260201e-16,
377 1.7890045740290426e-16,
378 3.9055801830046285e-17,
379 8.2021830423836414e-18
381 static const double a_0999[] = {
383 0.0010948643551945106,
384 4.9339775513703531e-05,
385 5.8106148827030648e-06,
386 9.0297933642160258e-07,
387 1.6071611723980855e-07,
388 3.1022996460780713e-08,
389 6.3215527873357896e-09,
390 1.3390319160991274e-09,
391 2.9201310679876942e-10,
392 6.5142659671346827e-11,
393 1.479866018397699e-11,
394 3.4122968226239452e-12,
395 7.9664971347960851e-13,
396 1.879570420951645e-13,
397 4.474770189598618e-14,
398 1.0737054175239111e-14,
399 2.5943473663175315e-15,
400 6.3022348996212765e-16,
401 1.5338621163551473e-16,
402 3.5530854052596389e-17
404 static const double a_09999[] = {
406 -1.3929527778011679e-07,
407 -3.5807158709469604e-08,
408 1.5121654311494091e-09,
409 5.3970512437778956e-10,
410 1.749186943964158e-10,
411 6.0104289187874681e-11,
412 2.1852250560483192e-11,
413 8.3138373108038966e-12,
414 3.2790311109965967e-12,
415 1.3312071301023399e-12,
416 5.5334276553985535e-13,
417 2.3455336032391335e-13,
418 1.0107390081969312e-13,
419 4.4169493005249048e-14,
420 1.9535843986653469e-14,
421 8.7294821875382235e-15,
422 3.9322541378815156e-15,
423 1.7738812444397418e-15,
424 7.8254356946136493e-16,
425 2.9694490500757159e-16
427 static const double a_099999[] = {
429 -2.3380627410207544e-08,
430 7.6175735905551203e-10,
431 1.9722123521977164e-10,
432 4.5532178143588751e-11,
433 1.2850367703835401e-11,
434 4.1082667969836677e-12,
435 1.4271380972653781e-12,
436 5.2590327616044593e-13,
437 2.0252111309884293e-13,
438 8.069314582432292e-14,
439 3.3036837980890544e-14,
440 1.3828425631761439e-14,
441 5.8957520165539961e-15,
442 2.5527953180570246e-15,
443 1.1198233767191412e-15,
444 4.9702409020479538e-16,
445 2.2307975985638059e-16,
446 9.959171384402562e-17,
447 4.3930839455615036e-17,
448 1.6866442724945631e-17
450 static const double a_09999996[] = {
452 -1.5114761508160367e-09,
453 1.0896504763822493e-10,
454 1.7720251693123193e-11,
455 4.6966472388221927e-12,
456 1.6006987608743089e-12,
457 6.3030644175405775e-13,
458 2.7258921186736259e-13,
459 1.2589734975431724e-13,
460 6.1043592262679418e-14,
461 3.0724725219390323e-14,
462 1.5930611038331021e-14,
463 8.4606542588704426e-15,
464 4.5831136091932846e-15,
465 2.5239245630639817e-15,
466 1.4093595668813952e-15,
467 7.9412388123700772e-16,
468 4.5025109219702187e-16,
469 2.5134387791958008e-16,
470 1.343533006409061e-16,
471 5.8508841166493046e-17
473 static const double a_1[] = {
475 -2.4059848555846177e-11,
476 2.281829848666116e-12,
477 3.737551769401022e-13,
478 1.1829146499963193e-13,
479 5.011304284900719e-14,
480 2.5138290919778954e-14,
481 1.4098805002109372e-14,
482 8.5589707444449261e-15,
483 5.5099928835836536e-15,
484 3.7094376842670246e-15,
485 2.5861164648247456e-15,
486 1.8543832557467907e-15,
487 1.353781298372793e-15,
488 1.0024481658126094e-15,
489 7.4729151025312198e-16,
490 5.559453154118945e-16,
491 4.0537544799109808e-16,
492 2.8139951100112463e-16,
493 1.7792919295671934e-16,
494 8.7158238215986494e-17
505 static const double minratio = 1.e-323;
506 const double xin = x;
508 unsigned degree = 20, near1 = 0;
514 xmin = log(minratio);
631 else if (x < 0.99999)
638 else if (x < 0.9999996)
653 x = 2.0*(x - xmin)/(xmax - xmin) - 1.0;
654 const long double twox = 2.0L*x;
655 long double rp2 = 0.0L, rp1 = 0.0L, r = 0.0L;
657 for (k = degree; k > 0U; --k)
659 r = twox*rp1 - rp2 + a[k];
663 double cheb = x*rp1 - rp2 + a[0];
665 cheb /= (pow(3.0/4.0*(1.0 - xin), 2.0/3.0) + 2.0);
|