<p dir="auto">Entering negative values for the first argument of scipy.special.mathieu_a yields NaN</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from scipy.special import mathieu_a
mathieu_a(-1,1)"><pre class="notranslate"><code class="notranslate">from scipy.special import mathieu_a
mathieu_a(-1,1)
</code></pre></div>
<p dir="auto">Whereas it should be well defined according to Mathematica.<br>
See evaluation of the function at this link:<br>
<a href="http://functions.wolfram.com/webMathematica/FunctionPlotting.jsp?name=MathieuCharacteristicA&amp;ptype=1&amp;r=-1&amp;q=2&amp;type=0&amp;line=0&amp;free=q&amp;xMin=-5&amp;xMax=5" rel="nofollow">http://functions.wolfram.com/webMathematica/FunctionPlotting.jsp?name=MathieuCharacteristicA&amp;ptype=1&amp;r=-1&amp;q=2&amp;type=0&amp;line=0&amp;free=q&amp;xMin=-5&amp;xMax=5</a></p>
<h3 dir="auto">Scipy/Numpy/Python version information:</h3>
 1.2.1 1.16.3 sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)
<p dir="auto">The order parameter in Mathieu functions need not be <a href="http://dlmf.nist.gov/28" rel="nofollow">positive, integer or even complex valued</a>, but that is the only type of input that <code class="notranslate">scipy.special</code> handles without resulting in <code class="notranslate">NaN</code>.</p>
<p dir="auto">Although the GSL implementation is also restricted to integers, it is not restricted to positive integers.  This could be easily handled in scipy as well by using the symmetry properties of Mathieu functions.</p>
<p dir="auto">Mathematica handles real and complex order without a problem.</p>
<p dir="auto">Handling real and complex orders requires different algorithms, such as the ones described in <a href="http://dl.acm.org/citation.cfm?doid=1163641.1163646" rel="nofollow">this article</a>, that also includes <code class="notranslate">C++</code> source, although it has a restrictive license.</p>