<p dir="auto">The scipy implementation of the hyp1f1 function exhibits a huge inaccuracy based on a comparison to mpmath's arbitrary-precision and double-precision implementations (shown below) as well as GSL, all of which agree (GSL gives <code class="notranslate">1.649746910616242567826e+00</code>). The input here comes from GSL's included tests.</p>
<h4 dir="auto">Reproducing code example:</h4>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Python 3.6.8 (default, Aug 20 2019, 17:12:48) 
[GCC 8.3.0] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; from mpmath import *
&gt;&gt;&gt; from scipy import special
&gt;&gt;&gt; mp.hyp1f1(100, 200, 1.0)
mpf('1.6497469106162459')
&gt;&gt;&gt; fp.hyp1f1(100, 200, 1.0)
1.6497469106162461
&gt;&gt;&gt; special.hyp1f1(100, 200, 1.0)
4.654116242484843e+42"><pre class="notranslate"><code class="notranslate">Python 3.6.8 (default, Aug 20 2019, 17:12:48) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; from mpmath import *
&gt;&gt;&gt; from scipy import special
&gt;&gt;&gt; mp.hyp1f1(100, 200, 1.0)
mpf('1.6497469106162459')
&gt;&gt;&gt; fp.hyp1f1(100, 200, 1.0)
1.6497469106162461
&gt;&gt;&gt; special.hyp1f1(100, 200, 1.0)
4.654116242484843e+42
</code></pre></div>
<h4 dir="auto">Scipy/Numpy/Python version information:</h4>
<p dir="auto">1.3.1 1.17.2 sys.version_info(major=3, minor=6, micro=8, releaselevel='final', serial=0)&lt;!-- You can simply run the following and paste the result in a code block</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)"><pre class="notranslate"><code class="notranslate">import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)
</code></pre></div>
<p dir="auto">--&gt;</p>
<p dir="auto">hyp1f1 explodes for modestly large arguments. For example:</p>
<p dir="auto">scipy.special.hyp1f1(30, 70, 20j)</p>
<p dir="auto">returns</p>
<p dir="auto">(-1748.2243027213672+51.441200608645886j)</p>
<p dir="auto">which is completely wrong (whenever 1 &lt; a &lt; b and z is purely imaginary, abs(1F1(a,b,z)) &lt;= 1).</p>
<p dir="auto">This doesn't seem to be insoluble, since the package mpmath (also open sourced here on GitHub) returns what seems to be the correct answer:</p>
<p dir="auto">mpmath.hyp1f1(30, 70, 20j)<br>
mpc(real='-0.32066129006007188', imag='0.38180277645752586')</p>
<p dir="auto">(I assume this is correct because Mathematica returns the same result. It would be very unlikely if they were both wrong and returned the same answer).</p>
<p dir="auto">Moreover, I did a simple test. Simply using the Taylor series expansion gives the correct result. The problem with scipy's implementation seems to be in using a recurrence relation to lower the value of 'a' until it is &lt; 2. The recurrence relation relation used is Abramowitz 13.4.1, but I think this is unstable.</p>