Bill Allombert on Tue, 11 Aug 2009 12:43:03 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: intnum() unfortunate events |
On Thu, Aug 06, 2009 at 03:18:57PM -0700, Ilya Zakharevich wrote: > ? f(N)=intnum(X=-N,N, erfc(X)*X) + erfc(-N)*N^2/2 - erfc(N)*N^2/2 > ? for(P=1,15, default(realprecision,10*P); print(10*P, " => ", f(100))) > 10 => 3.662944319 > 20 => 0.92567475529080305843 > > Note that this is a very different situation than spikes in the > integrant (which ARE very hard to detect). THIS ("jumps" of a > function sitting between grid points) would be detected by ANY minor > shift in the integration grid... > > Any thoughts? I supopose this is with PARI 2.3 PARI 2.4.2 intnum does not use grid points anymore, however it has strong regularity requirement on the complex plane. With PARI svn and splitting the integral at 0, you get the correct result: f(N)=intnum(X=-N,0, erfc(X)*X) + intnum(X=0,N, erfc(X)*X) + erfc(-N)*N^2/2 - erfc(N)*N^2/2 for(P=1,15, default(realprecision,10*P); print(10*P, " => ", f(100))) 10 => 0.5000000000 20 => 0.50000000000000000000 30 => 0.500000000000000000000000000000 40 => 0.5000000000000000000000000000000000000000 Cheers, Bill.