71 if (m < 0 || m > l ||
abs (x) > 1.0)
74 os <<
"legendre_poly: Condition 0 <= m <= l && -1 < x < 1 failed"
75 << endl <<
" l = " << l <<
" m = " << m <<
" x = " << x << endl;
76 throw runtime_error (os.str ());
84 somx2 = sqrt ((1.0 - x) * (1.0 + x));
86 for (
Index i = 1; i <= m; i++)
99 pmmp1 = x * (
Numeric)(2*m + 1) * pmm;
144 result = ((sqrt (2.0 *
fac (l - m) /
fac (l + m))
179 os <<
"legendre_poly_deriv: Condition x != 1 failed"
180 << endl <<
" x = " << x << endl;
181 throw runtime_error (os.str ());
193 result = x / sqrt(1 - x*x);
198 os <<
"legendre_poly_deriv: "
199 <<
"Condition l == 1 && (m == 0 || m == 1) failed" << endl
200 <<
"l = " << l <<
" m = " << m << endl;
201 throw runtime_error (os.str ());
212 catch (runtime_error e)
215 os << e.what () <<
"legendre_poly_deriv: "
216 <<
"Condition m < l failed" << endl
217 <<
"l = " << l <<
" m = " << m << endl;
218 throw runtime_error (os.str ());
229 catch (runtime_error e)
232 os << e.what () <<
"legendre_poly_norm_schmidt_deriv: "
233 <<
"Condition m = l failed" << endl
234 <<
"l = " << l <<
" m = " << m << endl;
235 throw runtime_error (os.str ());
263 os <<
"legendre_poly_norm_schmidt_deriv: Condition x != 1 failed"
264 << endl <<
" x = " << x << endl;
265 throw runtime_error (os.str ());
274 result = sqrt (2.0 *
fac (1 - m) /
fac (1 + m));
278 result = sqrt (2.0 *
fac (1 - m) /
fac (1 + m)) * x / sqrt(1 - x*x);
283 os <<
"legendre_poly_norm_schmidt_deriv: "
284 <<
"Condition l == 1 && (m == 0 || m == 1) failed" << endl
285 <<
"l = " << l <<
" m = " << m << endl;
286 throw runtime_error (os.str ());
298 catch (runtime_error e)
301 os << e.what () <<
"legendre_poly_norm_schmidt_deriv: "
302 <<
"Condition m < l failed" << endl
303 <<
"l = " << l <<
" m = " << m << endl;
304 throw runtime_error (os.str ());
315 catch (runtime_error e)
318 os << e.what () <<
"legendre_poly_norm_schmidt_deriv: "
319 <<
"Condition m = l failed" << endl
320 <<
"l = " << l <<
" m = " << m << endl;
321 throw runtime_error (os.str ());
354 if (m < 0 || m > l ||
abs (x) > 1.0)
357 os <<
"g_legendre_poly: Condition 0 <= m <= l && -1 < x < 1 failed"
358 << endl <<
" l = " << l <<
" m = " << m <<
" x = " << x << endl;
359 throw runtime_error (os.str ());
367 somx2 = sqrt ((1.0 - x) * (1.0 + x));
369 for (
Index i = 1; i <= m; i++)
382 pmmp1 = x * (
Numeric)(2*m + 1) * pmm;
428 result = ((sqrt (2.0 *
fac (l - m) /
fac (l + m))
464 os <<
"g_legendre_poly_deriv: Condition x != 1 failed"
465 << endl <<
" x = " << x << endl;
466 throw runtime_error (os.str ());
478 result = x / sqrt(1 - x*x);
483 os <<
"g_legendre_poly_deriv: "
484 <<
"Condition l == 1 && (m == 0 || m == 1) failed" << endl
485 <<
"l = " << l <<
" m = " << m << endl;
486 throw runtime_error (os.str ());
497 catch (runtime_error e)
500 os << e.what () <<
"g_legendre_poly_deriv: "
501 <<
"Condition m < l failed" << endl
502 <<
"l = " << l <<
" m = " << m << endl;
503 throw runtime_error (os.str ());
514 catch (runtime_error e)
517 os << e.what () <<
"g_legendre_poly_norm_schmidt_deriv: "
518 <<
"Condition m = l failed" << endl
519 <<
"l = " << l <<
" m = " << m << endl;
520 throw runtime_error (os.str ());
549 os <<
"g_legendre_poly_norm_schmidt_deriv: Condition x != 1 failed"
550 << endl <<
" x = " << x << endl;
551 throw runtime_error (os.str ());
564 result = x / sqrt(1 - x * x);
569 os <<
"g_legendre_poly_norm_schmidt_deriv: "
570 <<
"Condition l == 1 && (m == 0 || m == 1) failed" << endl
571 <<
"l = " << l <<
" m = " << m << endl;
572 throw runtime_error (os.str ());
580 result = sqrt (2.0 *
fac (l - m) /
fac (l + m)) *
584 catch (runtime_error e)
587 os << e.what () <<
"g_legendre_poly_norm_schmidt_deriv: "
588 <<
"Condition m < l failed" << endl
589 <<
"l = " << l <<
" m = " << m << endl;
590 throw runtime_error (os.str ());
597 result = sqrt (2.0 *
fac (l - m) /
fac (l + m)) *
602 catch (runtime_error e)
605 os << e.what () <<
"g_legendre_poly_norm_schmidt_deriv: "
606 <<
"Condition m = l failed" << endl
607 <<
"l = " << l <<
" m = " << m << endl;
608 throw runtime_error (os.str ());
638 os <<
"g_legendre_poly_norm_schmidt_deriv: Condition x != 1 failed"
639 << endl <<
" x = " << x << endl;
640 throw runtime_error (os.str ());
653 result = x / sqrt(1 - x * x);
658 os <<
"g_legendre_poly_norm_schmidt_deriv: "
659 <<
"Condition l == 1 && (m == 0 || m == 1) failed" << endl
660 <<
"l = " << l <<
" m = " << m << endl;
661 throw runtime_error (os.str ());
665 else if ( m <= l - 1 )
673 result = sqrt (2.0 *
fac (l - m) /
fac (l + m)) *
678 catch (runtime_error e)
681 os << e.what () <<
"g_legendre_poly_norm_schmidt_deriv: "
682 <<
"Condition m <= l - 1 failed" << endl
683 <<
"l = " << l <<
" m = " << m << endl;
684 throw runtime_error (os.str ());
691 result = - sqrt (2.0 *
fac (l - m) /
fac (l + m)) *
694 catch (runtime_error e)
697 os << e.what () <<
"g_legendre_poly_norm_schmidt_deriv: "
698 <<
"Condition m = l failed" << endl
699 <<
"l = " << l <<
" m = " << m << endl;
700 throw runtime_error (os.str ());
730 os <<
"g_legendre_poly_norm_schmidt_deriv: Condition x != 1 failed"
731 << endl <<
" x = " << x << endl;
732 throw runtime_error (os.str ());
745 result = x / sqrt(1 - x * x);
750 os <<
"g_legendre_poly_norm_schmidt_deriv: "
751 <<
"Condition l == 1 && (m == 0 || m == 1) failed" << endl
752 <<
"l = " << l <<
" m = " << m << endl;
753 throw runtime_error (os.str ());
761 result = - sqrt (2.0 *
fac (l - m) /
fac (l + m)) *
766 catch (runtime_error e)
769 os << e.what () <<
"g_legendre_poly_norm_schmidt_deriv: "
770 <<
"Condition m < l failed" << endl
771 <<
"l = " << l <<
" m = " << m << endl;
772 throw runtime_error (os.str ());
782 catch (runtime_error e)
785 os << e.what () <<
"g_legendre_poly_norm_schmidt_deriv: "
786 <<
"Condition m = l failed" << endl
787 <<
"l = " << l <<
" m = " << m << endl;
788 throw runtime_error (os.str ());
818 os <<
"g_legendre_poly_norm_schmidt_deriv: Condition x != 1 failed"
819 << endl <<
" x = " << x << endl;
820 throw runtime_error (os.str ());
833 result = x / sqrt(1 - x * x);
838 os <<
"g_legendre_poly_norm_schmidt_deriv: "
839 <<
"Condition l == 1 && (m == 0 || m == 1) failed" << endl
840 <<
"l = " << l <<
" m = " << m << endl;
841 throw runtime_error (os.str ());
849 result = sqrt(2.0 *
fac (l - m) /
fac (l + m)) *
854 catch (runtime_error e)
857 os << e.what () <<
"g_legendre_poly_norm_schmidt_deriv: "
858 <<
"Condition m < l failed" << endl
859 <<
"l = " << l <<
" m = " << m << endl;
860 throw runtime_error (os.str ());
867 result = - sqrt(2.0 *
fac (l - m) /
fac (l + m)) *
870 catch (runtime_error e)
873 os << e.what () <<
"g_legendre_poly_norm_schmidt_deriv: "
874 <<
"Condition m = l failed" << endl
875 <<
"l = " << l <<
" m = " << m << endl;
876 throw runtime_error (os.str ());
906 os <<
"g_legendre_poly_norm_schmidt_deriv: Condition x != 1 failed"
907 << endl <<
" x = " << x << endl;
908 throw runtime_error (os.str ());
921 result = x / sqrt(1 - x * x);
926 os <<
"g_legendre_poly_norm_schmidt_deriv: "
927 <<
"Condition l == 1 && (m == 0 || m == 1) failed" << endl
928 <<
"l = " << l <<
" m = " << m << endl;
929 throw runtime_error (os.str ());
937 result = sqrt (2.0 *
fac (l - m) /
fac (l + m)) *
940 / ((
Numeric)(2 * l + 1 ) * (1 - x * x)));
942 catch (runtime_error e)
945 os << e.what () <<
"g_legendre_poly_norm_schmidt_deriv: "
946 <<
"Condition m < l failed" << endl
947 <<
"l = " << l <<
" m = " << m << endl;
948 throw runtime_error (os.str ());
955 result = - sqrt (2.0 *
fac (l - m) /
fac (l + m)) *
958 catch (runtime_error e)
961 os << e.what () <<
"g_legendre_poly_norm_schmidt_deriv: "
962 <<
"Condition m = l failed" << endl
963 <<
"l = " << l <<
" m = " << m << endl;
964 throw runtime_error (os.str ());