Xu Table test of translation coeffs: fix erroneous table entry.

Change output format


Former-commit-id: dc3dcc3ce9abd84cfbd7107d2953c64fffd219de
This commit is contained in:
Marek Nečada 2018-05-02 19:47:35 +03:00
parent 34557fe5a4
commit 20595e0781
2 changed files with 6 additions and 5 deletions

View File

@ -8,7 +8,7 @@
{QPMS_NORMALISATION_XU, 22,40,-39,45, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .34997554e216 + .45574651e216 * I, -.23949371e214 + .18391132e214* I}, {QPMS_NORMALISATION_XU, 22,40,-39,45, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .34997554e216 + .45574651e216 * I, -.23949371e214 + .18391132e214* I},
{QPMS_NORMALISATION_XU, 5,50,-22,61, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .89567769e226 + -.12101307e227 * I, .50442227e224 + .37334790e224* I}, {QPMS_NORMALISATION_XU, 5,50,-22,61, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .89567769e226 + -.12101307e227 * I, .50442227e224 + .37334790e224* I},
// Yu-lin Xu, Journal of computational physics 139, 137165 (1998), Table 12 // Yu-lin Xu, Journal of computational physics 139, 137165 (1998), Table 12
{QPMS_NORMALISATION_XU, 8,10,-9,12, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .3663964990e+35 + -.2762412192e+35 * I, -.8370892023e+32 + -.1110285257e+32* I}, {QPMS_NORMALISATION_XU, 8,10,-9,12, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .3663964990e+35 + -.2762412192e+35 * I, -.8370892023e+32 + -.1110285257e+33* I /* N.B. article value is erroneous */},
{QPMS_NORMALISATION_XU, 0,10,0,10, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .2969682019e+00 + -.1928601440e+18 * I, .0000000000e+00 + .0000000000e+00* I}, {QPMS_NORMALISATION_XU, 0,10,0,10, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .2969682019e+00 + -.1928601440e+18 * I, .0000000000e+00 + .0000000000e+00* I},
{QPMS_NORMALISATION_XU, -2,11,3,9, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .7726121583e+12 + .1034255820e+13 * I, .1222239141e+11 + -.9130398908e+10* I}, {QPMS_NORMALISATION_XU, -2,11,3,9, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .7726121583e+12 + .1034255820e+13 * I, .1222239141e+11 + -.9130398908e+10* I},
{QPMS_NORMALISATION_XU, -12,13,10,15, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .3290937356e+01 + .1456483748e-01 * I, -.1763167849e-03 + .3983892680e-01* I}, {QPMS_NORMALISATION_XU, -12,13,10,15, {2., 0.5, 0.5}, QPMS_HANKEL_PLUS, .3290937356e+01 + .1456483748e-01 * I, -.1763167849e-03 + .3983892680e-01* I},

View File

@ -1,3 +1,4 @@
// c99 -ggdb -I .. -o translations_xutable translations_xutable_test.c ../translations.c ../gaunt.c -lgsl -lblas -lm
#include "translations.h" #include "translations.h"
#include <stdio.h> #include <stdio.h>
//#include <math.h> //#include <math.h>
@ -28,21 +29,21 @@ int main() {
complex double B = qpms_trans_single_B(QPMS_NORMALISATION_XU,tc->m, tc->n, tc->mu, tc->nu, tc->kdlj, false, tc->J); complex double B = qpms_trans_single_B(QPMS_NORMALISATION_XU,tc->m, tc->n, tc->mu, tc->nu, tc->kdlj, false, tc->J);
complex double A2 = qpms_trans_calculator_get_A(c, tc->m, tc->n, tc->mu, tc->nu, tc->kdlj, false, tc->J); complex double A2 = qpms_trans_calculator_get_A(c, tc->m, tc->n, tc->mu, tc->nu, tc->kdlj, false, tc->J);
complex double B2 = qpms_trans_calculator_get_B(c, tc->m, tc->n, tc->mu, tc->nu, tc->kdlj, false, tc->J); complex double B2 = qpms_trans_calculator_get_B(c, tc->m, tc->n, tc->mu, tc->nu, tc->kdlj, false, tc->J);
printf("A = %.16f+%.16fj, relerr=%.16f, J=%d\n", printf("A = %.16e+%.16ej, relerr=%.16e, J=%d\n",
creal(A), cimag(A), (0 == cabs(tc->result_A - A)) ? 0 : creal(A), cimag(A), (0 == cabs(tc->result_A - A)) ? 0 :
cabs(tc->result_A - A)/((cabs(A) < cabs(tc->result_A)) ? cabs(A) : cabs(tc->result_A)), cabs(tc->result_A - A)/((cabs(A) < cabs(tc->result_A)) ? cabs(A) : cabs(tc->result_A)),
tc->J); tc->J);
printf("A' = %.16f+%.16fj, relerr=%.16f, relerr2=%.3e\n", printf("A' = %.16e+%.16ej, relerr=%.16e, relerr2=%.3e\n",
creal(A2), cimag(A2), (0 == cabs(tc->result_A - A2)) ? 0 : creal(A2), cimag(A2), (0 == cabs(tc->result_A - A2)) ? 0 :
cabs(tc->result_A - A2)/((cabs(A2) < cabs(tc->result_A)) ? cabs(A2) : cabs(tc->result_A)), cabs(tc->result_A - A2)/((cabs(A2) < cabs(tc->result_A)) ? cabs(A2) : cabs(tc->result_A)),
(0 == cabs(A - A2)) ? 0 : (0 == cabs(A - A2)) ? 0 :
cabs(A - A2)/((cabs(A2) < cabs(A)) ? cabs(A2) : cabs(A)) cabs(A - A2)/((cabs(A2) < cabs(A)) ? cabs(A2) : cabs(A))
); );
printf("B = %.16f+%.16fj, relerr=%.16f, J=%d\n", printf("B = %.16e+%.16ej, relerr=%.16e, J=%d\n",
creal(B), cimag(B), (0 == cabs(tc->result_B - B)) ? 0 : creal(B), cimag(B), (0 == cabs(tc->result_B - B)) ? 0 :
cabs(tc->result_B - B)/((cabs(B) < cabs(tc->result_B)) ? cabs(B) : cabs(tc->result_B)), cabs(tc->result_B - B)/((cabs(B) < cabs(tc->result_B)) ? cabs(B) : cabs(tc->result_B)),
tc->J); tc->J);
printf("B' = %.16f+%.16fj, relerr=%.16f, relerr2=%.3e\n", printf("B' = %.16e+%.16ej, relerr=%.16e, relerr2=%.3e\n",
creal(B2), cimag(B2), (0 == cabs(tc->result_B - B2)) ? 0 : creal(B2), cimag(B2), (0 == cabs(tc->result_B - B2)) ? 0 :
cabs(tc->result_B - B2)/((cabs(B2) < cabs(tc->result_B)) ? cabs(B2) : cabs(tc->result_B)), cabs(tc->result_B - B2)/((cabs(B2) < cabs(tc->result_B)) ? cabs(B2) : cabs(tc->result_B)),
(0 == cabs(B - B2)) ? 0 : (0 == cabs(B - B2)) ? 0 :