Re: A question regarding a hyperbolic geometric function
- To: mathgroup at smc.vnet.net
- Subject: [mg86466] Re: A question regarding a hyperbolic geometric function
- From: "David W.Cantrell" <DWCantrell at sigmaxi.net>
- Date: Wed, 12 Mar 2008 00:10:43 -0500 (EST)
- References: <200803100704.CAA24775@smc.vnet.net> <fr5e09$o5p$1@smc.vnet.net>
"Ali K. Ozdagli" <ozdagli at gmail.com> wrote: > Hi Bob and all, > > I originally figured this problem while I was working with a second > order ODE of which solution involves Hypergeometric1F1. I have plugged > the solution back to the ODE and it turned out that the equation is > not satisfied for all values of the independent variable. I know the > solution is correct as I have checked it both with Mathematica and > another software. The mistake in the result becomes apparent when you > check the accuracy and precision with Accuracy[] and Precision[]. For > example, Hypergeometric1F1[-26.9, -20.1, 30000] gives > > 5.868090710725125*10^13007 > > However, if you check accuracy and precision of the result you get > > Accuracy[Hypergeometric1F1[-26.9, -20.1, 30000]] = -12991.8 (negative is > bad!!!) > Precision[Hypergeometric1F1[-26.9, -20.1, 30000]] = 15.9546 > > Where the latter is also the machine precision in Mathematica. This > means that the results are precisely wrong although we want them to be > roughly correct. :) > > Any ideas about this? Both Accuracy and Precision are as one should expect! And they have nothing to do with the particular function, Hypergeometric1F1. Consider that In[42]:= Accuracy[6. * 10^13007] Out[42]= -12991.8 In[43]:= Precision[6. * 10^13007] Out[43]= 15.9546 give the same values you had. Now let's look at an example with a smaller third argument: In[45]:= N[Hypergeometric1F1[-269/10, -201/10, 3000]] Out[45]= 4.389014940203321*10^1288 Note that this is still a very large number. It should be no surprise that In[46]:= Accuracy[N[Hypergeometric1F1[-269/10, -201/10, 3000]]] Out[46]= -1272.69 And it's easy to predict that, if we want Accuracy to be positive, we'll need to request at least 1289 digits. In[47]:= Accuracy[N[Hypergeometric1F1[-269/10, -201/10, 3000], 1289]] Out[47]= 0.357633 BTW, I'm quite skeptical that you actually _need_ such Accuracy. For most purposes, high Precision is adequate. David > On 3/10/08, Bob Hanlon <hanlonr at cox.net> wrote: > > v1 = Hypergeometric1F1[-26.9, -20.1, 30000] > > > > 5.86809071072512533577549124209830605005026`\ > > 15.954589770191005*^13007 > > > > Use exact values until evaluating the Hypergeometric1F1 with extended > > precision > > > > v2 = N[Hypergeometric1F1[-269/10, -201/10, 30000], 100] > > > > 5.86809071072500808515263985241332834422719\ > > \ > > 6477241041525402740155487068020893691436344\ > > \ > > 4849172908349727305685895816448516416585189\ > > 1451997662`100.*^13007 > > > > Although even without extra precision v1 is very close to v2 > > > > (v1 - v2)/v2 > > > > 1.99810515261962031039159`2.2552081099371497\ > > *^-14 > > > > > > > > Bob Hanlon > > > > > > ---- "Ali K. Ozdagli" <ozdagli at gmail.com> wrote: > > > Hi, > > > > > > I am working with Mathematica in order to solve an ordinary > > > differential equation with several boundary conditions. It turned > > > out that the solution is Kummer confluent hypergeometric function, > > > HyperGeometric1F1[a,b,x]. My problem is that for the values of a, b > > > and x I am interested in, e.g. a=-26.9, b=-20.1, x=300000, the > > > numerical accuracy of Mathematica is very poor. > > > > > > Can somebody suggest me a way to improve the mathematical accuracy > > > of HyperGeometric1F1? I prefer a quick and easy way but also > > > appreciate any hard way. > > > > > > Best, > > > > > > Ali > > > > > > -- > > > > > > Ali K. Ozdagli > > > Ph.D. Student in Economics > > > at University of Chicago > > > > > > >
- References:
- A question regarding a hyperbolic geometric function
- From: "Ali K. Ozdagli" <ozdagli@gmail.com>
- A question regarding a hyperbolic geometric function