On Dec 12, 2007 3:20 AM, pgdoyle <[EMAIL PROTECTED]> wrote:
>
> The description of Bessel_K functions in the Sage Cookbook is
> confusing about the order of the arguments.
> http://sagemath.org/doc/html/const/node96.html
> Here's what it says:
>
> >Here's an example using SAGE's interface to pari's special functions.
>
> >sage: pari('2+I').besselk(3)
> >0.04559077184075505871203211094 + 0.02891929465820812820828883526*I     # 
> >32-bit
> >0.045590771840755058712032110938791854704 + 
> >0.028919294658208128208288835257608789842*I   # 64-bit
> >sage: pari('2').besselk(3)  # random
> >0.061510458471742038
>
> >The last command can also be executed using the SAGE command
>
> >sage: bessel_K(3,2)
> >0.647385390948634
> >sage: bessel_K(3,2,100)
> >0.64738539094863415315923557097
>
> But in fact the answer 0.061510458471742038 is correct, not random:

"Random" here doesn't mean what you think. All SAGE docs are
tested for correctness by an automatic testing program written by
William Stein. Since it is run on different machines, and different
machines give
slightly different round-off errors at the last few places, those last
few places are "random". Here "# random" is a key word that indicates
to the tester that the last few places are possibly different.


>
> sage: bessel_K(2,3)
> 0.0615104584717420
> sage: bessel_K(2,3,100)
> 0.061510458471742037656820071453
>
> I believe the confusion resulted because in earlier versions of Sage
> the order of arguments to
> bessel_K was backwards.  For instance in Sage 2.8.5:
>
> sage: bessel_K(2,3)
> 0.647385390948634  # WRONG!!!
>
> Cheers,
>
> Peter
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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/
-~----------~----~----~----~------~----~------~--~---

Reply via email to