[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] gsl_sf_legendre_Plm_e sign error

From: Robin Hankin
Subject: [Help-gsl] gsl_sf_legendre_Plm_e sign error
Date: Wed, 10 Nov 2004 09:13:09 +0000

Hi everyone.

(newbie here.  I've been lurking for a while).

I'm working with Legendre functions and I'm trying to reproduce Abramowitz and Stegun's
figure 8.2 which shows $P^1_n(x)$.

Here's the relevant bit of my code.  I am a C novice!   (any advice on coding
style gratefully received).

void legendre_Plm_e(int *l, int *m, double *x, int *nx, double *val, double *err, int *status)
  int i;
  gsl_sf_result result;

  for(i = 0; i< *nx ; i++){
    status[i]  = gsl_sf_legendre_Plm_e(*l, *m, x[i] , &result) ;
    val[i] = result.val;
    err[i] = result.err;

I get a sign error:  A&S have $P_1^1(0) ==1$, and I get -1.

Could anyone confirm that I've not introduced an invisible minus sign into my coding?

best wishes

Robin Hankin
Uncertainty Analyst
Southampton Oceanography Centre
SO14 3ZH
tel +44(0)23-8059-7743
address@hidden (edit in obvious way; spam precaution)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]