Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Re[2]: Re: Numerical accuracy of Hypergeometric2F1

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55829] Re: [mg55776] Re: Re[2]: [mg55743] Re: Numerical accuracy of Hypergeometric2F1
  • From: DrBob <drbob at bigfoot.com>
  • Date: Thu, 7 Apr 2005 05:10:08 -0400 (EDT)
  • References: <200504060711.DAA13518@smc.vnet.net>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

Actually, we don't need "higher" precision at all. We just need different arithmetic.

Even 1 digit of arbitrary precision is enough to get a reasonable answer... but machine precision is not:

r = Integrate[x^100/(x + 2),
     {x, 0, 1}];
N[r, 1]

0.003

N[r]

2.81474976710656*^14

Bobby

On Wed, 6 Apr 2005 03:11:04 -0400 (EDT), Bob Hanlon <hanlonr at cox.net> wrote:

> Integrate[x^100/(x+2),{x,0,1}]
>
> -(1317479497632370191204744890981021191757330191571416507401
> 36152126531/
>     256324908932766460163727238732765821900) -
> 1267650600228229401496703205376*Log[2] +
>   1267650600228229401496703205376*Log[3]
>
> N[%]
>
> 2.81474976710656*^14
>
> Need slightly higher precision
>
> N[%%,20]
>
> 0.00331118591352665013637705575274490534`20.000000000000004
>
> NIntegrate[x^100/(x+2),{x,0,1}]
>
> 0.003311185913526502
>
>
> Bob Hanlon
>
>>
>> From: Janos TOTH <jtoth at helka.iif.hu>
To: mathgroup at smc.vnet.net
>> Date: 2005/04/05 Tue AM 07:27:22 EDT
>> CC: mathgroup at smc.vnet.net
>> Subject: [mg55829] [mg55776] Re[2]: [mg55743] Re: Numerical accuracy of Hypergeometric2F1
>>
>> Hello Bob,
>>
>> I am sorry, I have mistyped something,
>> but I am interested in the integral on
>> [0,1] and _not_ on [0,2]!
>>
>> Thank you for your quick check.
>>
>> Janos
>>
>> Tuesday, April 5, 2005, 12:39:10 PM, you wrote:
>>
>> BH> Works on my version
>>
>> BH> $Version
>>
>> BH> 5.1 for Mac OS X (January 27, 2005)
>>
>> BH> Integrate[x^100/(x+2),{x,0,2}]
>>
>> BH>
> -(9503343334714997237896336168082647022052771377490530168503
>> BH> 53071587328/
>> BH>     1089380862964257455695840764614254743075) -
>> BH> 1267650600228229401496703205376*Log[2] +
>> BH>   1267650600228229401496703205376*Log[4]
>>
>> BH> %//N
>>
>> BH> 6.306563320381821*^27
>>
>> BH> NIntegrate[x^100/(x+2),{x,0,2}]
>>
>> BH> 6.306563320381638*^27
>>
>>
>> BH> Bob Hanlon
>>
>> >>
>> >> From: "janos" <jtoth at helka.iif.hu>
To: mathgroup at smc.vnet.net
>> >> Date: 2005/04/05 Tue AM 03:21:13 EDT
>> >> To: mathgroup at smc.vnet.net
>> >> Subject: [mg55829] [mg55776] [mg55743] Re: Numerical accuracy of Hypergeometric2F1
>> >>
>> >> I wanted to calculate Integrate[x^100/(x+2),{x,0,2}] and even the sign
>> >> of the result is just negatvie. The reason is the same as above:
> Mathematica
>> >> calculates the integral symbolically, using a hypergeometric function,
>> >> then (s)he is unable to numerically evaluate it.
>> >> I got the good result if I used NIntegrate.
>> >> Janos Toth
>> >> Dept Math Anal
>> >> Budapest Univ Technol Ecol.
>> >>
>> >>
>>
>>
>>
>>
>> Best regards,
>>  Janos                            mailto:jtoth at helka.iif.hu
>> Tel. (home): 36-1-242-0640
>> Tel. (office): 36-1-463-2314
>> or  36-1-463-2475
>> Fax: 36-1-463-3172
>> Homepage: www.math.bme.hu/~jtoth
>>
>>
>
>
>
>



-- 
DrBob at bigfoot.com


  • Prev by Date: Re: Having trouble with substitution tile at higher iteration levels--> takes forever!
  • Next by Date: Re: Re: 3D graphics domain
  • Previous by thread: Re: Re[2]: Re: Numerical accuracy of Hypergeometric2F1
  • Next by thread: Re: Numerical accuracy of Hypergeometric2F1