From 5cf2c97e6b2e21fea7ee8c5536ded842703cf9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Wed, 12 Apr 2017 16:12:12 +0300 Subject: [PATCH] Fix some problems with nans (invalid arguments of Legendre polynomials), still having some problems with gaunt Former-commit-id: e551b05175ee14cd39e489589262dd82a83923fa --- qpms/translations.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qpms/translations.c b/qpms/translations.c index ec06610..53a768e 100644 --- a/qpms/translations.c +++ b/qpms/translations.c @@ -85,8 +85,9 @@ complex double qpms_trans_single_A_Taylor(int m, int n, int mu, int nu, sph_t kd complex double sum = 0; for(int q = 0; q <= qmax; ++q) { int p = n+nu-2*q; - double a1q_n = a1q[q] / a1q0; int Pp_order = mu-m; + if(p < abs(Pp_order)) continue; // FIXME raději nastav lépe meze + double a1q_n = a1q[q] / a1q0; double Pp = leg[gsl_sf_legendre_array_index(p, abs(Pp_order))]; if (Pp_order < 0) Pp *= min1pow(mu-m) * exp(lgamma(1+p+Pp_order)-lgamma(1+p-Pp_order)); complex double zp = bes[p];