upiterbarg / mpmath

Automatically exported from code.google.com/p/mpmath
Other
0 stars 0 forks source link

mpmath and mathematica diverge at nearly 186 digits #231

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. definite integral using mpmath quadts for tanh-sinh quadrature:
2. function to integrate is 
1/sqrt((.0000812*(1+x)^4)+(.2719188*(1+x)^3)+(0*(1+x)^2)+.728)
3. from 0 to 1e+13
4. in excess of 200 digits accuracy

What is the expected output? What do you see instead?
expected output is as per mathematica result in attached file resultmath.docx 
and what i see is in attached file test.txt

What version of the product are you using? On what operating system?
python 2.7 mpmath-0.17, python 2.7.3 on windows 7

Please provide any additional information below.

Original issue reported on code.google.com by vick1...@orange.mu on 6 Dec 2012 at 10:27

Attachments:

GoogleCodeExporter commented 9 years ago
I think this is due to the large integration interval. In fact the error 
estimate returned with error=True seems accurate. As a workaround you could 
perhaps replace the single integration interval with something like 
[0,1e1,1e2,1e3,1e4,1e5,1e6,1e13]. It would obviously be a great improvement to 
have space-adaptive quadrature that deals 
automatically with this kind of integral.

Original comment by fredrik....@gmail.com on 6 Dec 2012 at 2:03

GoogleCodeExporter commented 9 years ago
Actually it is the online mathematica version that was at fault! I checked the 
result from a student version and a trial version and both of them concur with 
mpmath! Thanks!

Original comment by vick1...@orange.mu on 9 Dec 2012 at 10:38