Special functions , associated Legendre type 3

GitHub - JuliaMath/SpecialFunctions.jl: Special mathematical functions in Julia is becoming the main repo for special functions.

Note, however, that it looks like your code can be substantially improved. For on thing, the integer type used should depend on the type of the arguments—you shouldn’t unconditionally convert to BigInt. Also, when you’re computing polynomial series, you almost never want to compute each term in the series independently (with calls to ^, factorial, binomial etcetera). Instead, you want to compute each term as a recurrence from the previous term, analogous to Horner’s method. (This also helps to avoid overflow from the individual terms in ratios of factorials.)

See, for example, how I compute the Taylor series for the exponential integral in this notebook: https://github.com/mitmath/18S096/blob/iap2017/pset3/pset3-solutions.ipynb

5 Likes