Thanks for catching that. But even with Polynomials, the code computes the
coefficients of the polynomial in the monomial basis, not the value of the
polynomial at a given x. Using the former to compute the latter is
dangerous because it is numerically unstable.

julia> Hermite48(x) =
20007974164906320568399715106816000000-960382759915503387283186325127168000000x^2+7362934492685525969171095159308288000000x^4-21597941178544209509568545800637644800000x^6+32396911767816314264352818700956467200000x^8-28797254904725612679424727734183526400000x^10+16580237672417776997244540210590515200000x^12-6559214903374065625283554369024819200000x^14+1858444222622651927163673737890365440000x^16-388694216496240925942729147794063360000x^18+61372771025722251464641444388536320000x^20-7439123760693606238138356895580160000x^22+700787020934904935476801736540160000x^24-51750426161346826004440743621427200x^26+3011929564946111566396022115532800x^28-138479520227407428340046993817600x^30+5025466459865592157501705420800x^32-143328811689571255828925644800x^34+3185084704212694573976125440x^36-54368444453132766554357760x^38+697031339142727776337920x^40-6476481664508504309760x^42+41077050726269583360x^44-158751886864809984x^46+281474976710656x^48
Hermite48 (generic function with 1 method)

julia> Hermite48(2.0)
1.13060295173709763271490845506831122432e+38 with 256 bits of precision

julia> Hermite48(2) #Integer overflow even with BigInt
-42115274364030603711130058827879640052269056

Reply via email to