<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/750" rel="nofollow">http://projects.scipy.org/scipy/ticket/750</a> on 2008-10-09 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ilanschnell/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ilanschnell">@ilanschnell</a>, assigned to unknown.</em></p>
<p dir="auto">The Bessel function special.jn(3,4) in inaccurate.<br>
Across different operating systems (OSX, Windows, Linux) and<br>
different version of scipy recent being 0.7.0.dev4673,<br>
the following little program</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from numpy import linspace
import scipy.special

N = 5
x = linspace(3.999, 4.001, N)
y = scipy.special.jn(3, x)

for i in xrange(N):
    print &quot;%10.6f  %10.6f&quot; % (x[i], y[i])"><pre class="notranslate"><code class="notranslate">from numpy import linspace
import scipy.special

N = 5
x = linspace(3.999, 4.001, N)
y = scipy.special.jn(3, x)

for i in xrange(N):
    print "%10.6f  %10.6f" % (x[i], y[i])
</code></pre></div>
<p dir="auto">gives this output</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  3.999000    0.430130
  3.999500    0.430151
  4.000000    0.397150
  4.000500    0.430192
  4.001000    0.430213"><pre class="notranslate"><code class="notranslate">  3.999000    0.430130
  3.999500    0.430151
  4.000000    0.397150
  4.000500    0.430192
  4.001000    0.430213
</code></pre></div>
<p dir="auto">The value at x=4.0 is incorrect, as the Bessel function does not have a kink in this region.</p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/623" rel="nofollow">http://projects.scipy.org/scipy/ticket/623</a> on 2008-03-17 by trac user wa03, assigned to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dmcooke/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dmcooke">@dmcooke</a>.</em></p>
<p dir="auto">The following code produces a plot with a discontinuous Bessel function, Jv:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from scipy import special
from numpy import arange
from pylab import *

x = arange(0, 10, 0.1)
y = special.jv(3,x)
plot(x,y)
show()"><pre class="notranslate"><code class="notranslate">from scipy import special
from numpy import arange
from pylab import *

x = arange(0, 10, 0.1)
y = special.jv(3,x)
plot(x,y)
show()
</code></pre></div>
<p dir="auto">At the point x = 4.0 there is a discontinuity. If the dx is lessened (dx = x(2)-x(1)), the function is smooth except at x = 4.0. The plotting is not necessary for the bug to appear, but it helps with viewing the error.</p>
<p dir="auto">I have tried using scipy 0.6.0 on both python 2.4.x and python 2.5.x--specifically, 2.4.4 and 2.5.2. The version of numpy used is 1.0.4.</p>
<p dir="auto">Cheers,</p>
<p dir="auto">Josh</p>
<p dir="auto">P.S. I think this is a very severe bug for reliability of computations but I am unaware of the etiquette for new tickets and what qualifies as a major severity or normal or blocking, etc. I apologize if I inappropriately marked this higher than should be.</p>