       Re: Erroneous Mathematica Kummer's (Hypergeometric1F1)

• To: mathgroup at smc.vnet.net
• Subject: [mg81461] Re: [mg81444] Erroneous Mathematica Kummer's (Hypergeometric1F1)
• From: Carl Woll <carlw at wolfram.com>
• Date: Mon, 24 Sep 2007 04:17:39 -0400 (EDT)
• References: <200709240114.VAA01940@smc.vnet.net>

```W. Brenig wrote:

>Hi,
>
>This excerpt from a notebook demonstrates that Mathematica's
>implementation of the confluent hypergeometric function is
>erroneous. The integral representation of the Hypergeometric1F1[]
>function is
>
>In:= f11[m_, n_, z_] := ((n - 1)!/((n - m - 1)! (m - 1)!))
>   NIntegrate[Exp[ x z] x^(m - 1) (1 - x)^(n - m - 1), {x, 0, 1}];
>
>Now, we use this representation to evaluate f11 for two
>representative sets of parameters
>
>In:= f11[5, 106, 10 Pi I]
>Out= 0.101285+ 0.811816 \[ImaginaryI]
>
>In:= f11[4.6, 105.3, 10 Pi I]
>Out= 0.190397+ 0.80675 \[ImaginaryI]
>
>These values have also been tested to result on use of the
>routine CCHG(A,B,Z,CHG) for the confluent 1F1 hypergeometric
>function, copyrighted to Zhang and Jin, authors of the book
>'Computation of Special Functions', Wiley-Interscience, (1996).
>
>Next we use Mathematica's Hypergeometric1F1[] function with
>the same parameters
>
>In:= N[Hypergeometric1F1[5, 106, 10 Pi I]]
>Out= -5952. - 2512. \[ImaginaryI]
>
>In:= N[Hypergeometric1F1[4.6, 105.3, 10 Pi I]]
>Out= 0.190397+ 0.80675 \[ImaginaryI]
>
>Obviously the 1st result is different from f11's value.
>This is only one of many other examples, which show that
>Mathematica's Hypergeometric1F1[] is broken - at least for
>integer value input parameters.
>
>
Actually, Hypergeometric1F1 is working fine. What goes wrong is
evaluating the result of 1F1 with machine numbers. As is typical of
machine numbers when subtracting large numbers, catastrophic loss of
precision occurs. Use extended precision numbers, as in:

In:= N[Hypergeometric1F1[5, 106, 10 Pi I], 20]

Out= 0.10128468746141561560+0.81181630676361012768 \[ImaginaryI]

When using extended precision numbers, Mathematica will internally
generate numbers to higher precision to attempt to get a result with the
requested precision. When using machine numbers, no such significance
tracking is done.

Alternatively, use at least one machine number as an argument to
Hypergeometric1F1:

In:= Hypergeometric1F1[5., 106, 10 Pi I]

Out= 0.101285+0.811816 \[ImaginaryI]

Carl Woll
Wolfram Research

>Regards,
>Wolfram
>
>

```

• Prev by Date: Software announcement: Adding bookmark for PDF generated from notebook
• Next by Date: making a list using table but with different increment after a certain number
• Previous by thread: Erroneous Mathematica Kummer's (Hypergeometric1F1) function
• Next by thread: Re: Erroneous Mathematica Kummer's (Hypergeometric1F1)