From e3713d61a387d5e0508f1ae6f6162f654df0fe42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Thu, 26 Apr 2018 11:13:15 +0300 Subject: [PATCH] Ppfac for the "new" B-coefficient Former-commit-id: aea661c0419d2b619e79044960728a225a7f7132 --- qpms/translations.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qpms/translations.c b/qpms/translations.c index f493368..89f6717 100644 --- a/qpms/translations.c +++ b/qpms/translations.c @@ -477,7 +477,7 @@ static void qpms_trans_calculator_multipliers_A_general( int Pp_order = mu - m; assert(p >= abs(Pp_order)); double a1q_n = a1q[q] / a1q0; - // Assuming non_normalized legendre polynomials! + // Assuming non_normalized legendre polynomials (normalisation done here by hand)! double Ppfac = (Pp_order >= 0) ? 1 : min1pow(mu-m) * exp(lgamma(1+p+Pp_order)-lgamma(1+p-Pp_order)); double summandfac = (n*(n+1) + nu*(nu+1) - p*(p+1)) * min1pow(q) * a1q_n; @@ -521,11 +521,16 @@ void qpms_trans_calculator_multipliers_B_general( for(int q = BQ_OFFSET; q <= Qmax; ++q) { int p = n+nu-2*q; + int Pp_order = mu - m; + // Assuming non-normalised Legendre polynomials, normalise here by hand. + // Ppfac_ differs from Ppfac in the A-case by the substitution p->p+1 + double Ppfac_ = (Pp_order >= 0)? 1 : + min1pow(mu-m) * exp(lgamma(1+1+p+Pp_order)-lgamma(1+1+p-Pp_order)); double t = sqrt( (isq(p+1)-isq(n-nu)) * (isq(n+nu+1)-isq(p+1)) ); - dest[q-BQ_OFFSET] = presum * t + dest[q-BQ_OFFSET] = presum * t * Ppfac_ * cruzan_bfactor(-m,n,mu,nu,p) * ipow(p+1); } }