private static double P(int l, int m, double x) { return(Functions.Pow(-1, m) * Functions.Pow(1 - x * x, m / 2.0)); }