On Dec 12, 2007 2:44 PM, pgdoyle <[EMAIL PROTECTED]> wrote: > > To get back to the question of argument order, it seems strange to me > that > pari(2).besselk(3) > should meant K_2(3) rather than K_3(2). > > sage: pari(2).besselk(3) > 0.06151045847174203765682007145 > sage: bessel_K(2,3) > 0.0615104584717420 > > bessel_K(nu,x) is written K_nu(x) because the first argument nu is in > some sense a parameter - in many cases an integer - identifying > K_nu as the nu'th Bessel function of type K. So I would naively > imagine that > pari(2).besselk(3) > would mean `take the 3rd bessel function and apply it to 2'. > > Is there some general philosophy that dictates the opposite behavior? > Like, say, "f(x,y) always translates to x.f(y)"?
Yes. In all of the interfaces, "f(x,y) *always* translates to x.f(y)". In most situations this is the most natural choice. > As a preview of an issue I'll raise in a separate post, note that Sage > is not giving us its best with bessel_K: > > sage: bessel_K(2+I,3+I) > Traceback (most recent call last): > ... > TypeError: Unable to convert x > (='0.043192827269587267-0.040059538066532876*I') to real number. > > The answer here is correct, and the only problem is that Sage was > expecting the result to be a real number. Fix it and submit a patch :-). The think the special functions could be greatly improved. I'll actually be posting a vague pie in the sky grant proposal to sage-* for feedback in about 3 or 4 days about improving special functions in Sage.... william --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/ -~----------~----~----~----~------~----~------~--~---