specfunc\legendre_poly.c line 291 calculates the checkup value to prevent overflow, when l==m the checkup fails and overflow is returned even for l = m = 0 for all values of x. -- Best regards, Svyatoslav Savenko