[SciPy-user] modified bessel fn of second kind K(n,z)

Robert Kern rkern at ucsd.edu
Fri Apr 22 19:35:21 CDT 2005


r help wrote:
> hi
> 
> i am trying to use the modified bessel function of the
> second kind, K_n(z) 
> 
> K is called the mod. bes. fn of second kind on
> mathworld; 
> K is called the mod. bes. fn of third kind in scipy.
> 
> the integer order function special.kn(-20,3) gives the
> same result on both mathematica and scipy:
> 
> In [3]: special.kn(-20,3)
> Out[3]: 16254643952204.371
> 
> however the real valued special.kv(-20,3) gives
> different answers each time i call it:
> 
> In [2]: special.kv(-20,3)
> Out[2]: -1.9924087524414062
> 
> In [4]: special.kv(-20,3)
> Out[4]: 166558.53135225689
> 
> In [5]: special.kv(-20,3)
> Out[5]: 166541.5313522513

[etc]

On a Mac:

In [1]:special.kv(-20,3)
Out[1]:-1.990829468774475

In [2]:special.kv(-20,3)
Out[2]:9.3170894640213688e-309

In [3]:special.kv(-20,3)
Out[3]:9.3170894640213688e-309

Hmmm. Something fishy's going on here.

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter



More information about the SciPy-user mailing list