From 20595e0781cc9e5a31d74a140362da7d70ced85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Wed, 2 May 2018 19:47:35 +0300 Subject: [PATCH] Xu Table test of translation coeffs: fix erroneous table entry. Change output format Former-commit-id: dc3dcc3ce9abd84cfbd7107d2953c64fffd219de --- qpms/tests/testcases_translations_Xu | 2 +- qpms/tests/translations_xutable_test.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/qpms/tests/testcases_translations_Xu b/qpms/tests/testcases_translations_Xu index 1923bcf..51dc266 100644 --- a/qpms/tests/testcases_translations_Xu +++ b/qpms/tests/testcases_translations_Xu @@ -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, 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, 137–165 (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, -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}, diff --git a/qpms/tests/translations_xutable_test.c b/qpms/tests/translations_xutable_test.c index d87ec26..21ce6b3 100644 --- a/qpms/tests/translations_xutable_test.c +++ b/qpms/tests/translations_xutable_test.c @@ -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 //#include @@ -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 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); - 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 : cabs(tc->result_A - A)/((cabs(A) < cabs(tc->result_A)) ? cabs(A) : cabs(tc->result_A)), 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 : cabs(tc->result_A - A2)/((cabs(A2) < cabs(tc->result_A)) ? cabs(A2) : cabs(tc->result_A)), (0 == cabs(A - A2)) ? 0 : 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 : cabs(tc->result_B - B)/((cabs(B) < cabs(tc->result_B)) ? cabs(B) : cabs(tc->result_B)), 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 : cabs(tc->result_B - B2)/((cabs(B2) < cabs(tc->result_B)) ? cabs(B2) : cabs(tc->result_B)), (0 == cabs(B - B2)) ? 0 :