Hello



Hi Vickram:

I have access to Maple 12 and Mathematica 8 Student editions.  I have computed this integral with both.

Mathematica

f[x] := 1/  Sqrt[(812/10^7 (1 + x)^4) + (2719188/10^7 (1 + x)^3) + 728/1000];
NIntegrate[f[x], {x, 0, 10^13}, WorkingPrecision -> 2000,   AccuracyGoal -> 350, MaxRecursion -> 12];
N[%, 350]
-> 
3.37384610380011411639276017299071962336315208512187429308244524692045\
4083831592619860587001647852397157609808820051137444090274914547366982\
6567770689784941030012023564186263482078797150167736067372209208550072\
9400684840196362348221869360897821068576910702514214008864442443503717\
6845021973313727527210853511703545228534630327760394887402637131280984\
3


Maple 12,

Digits:=3000;
evalf[350](int(1/sqrt((812/10^7 * (1 + x)^4) + (2719188/10^7 * (1 + x)^3) + 728/1000), x = 0..10^13));
-> 3.37384610380011411639276017299071962336315208512187429308244524692045
4083831592619860587001647852397157609808820051137444090274914547366982
6567770689784941030012023564186263482078797150167736067372209208550072
9400684840196362348221869360897821068576910702514214008864442443503717
68450219733137275272108535117035452285346303277603948874026371313161363

[Mathematica  8 answer] ? [Maple 12 answer] = 3.5152*10^-344

My 2 cents worth, I hope this helps.  Disclaimer, I am just a amateur/student.  (Maple 12 is faster).

Richard Hennessy



From: Stavros Macrakis 
Sent: Saturday, December 08, 2012 3:17 PM
To: Vickram 
Cc: maxima mailing list 
Subject: Re: [Maxima] Hello

Vickram, 


Thanks for the additional information.  I am forwarding your reply to the whole mailing list, as I am not a specialist in numerical quadrature, but others on the list are.


            -s

On Sat, Dec 8, 2012 at 6:34 AM, Vickram <vick1975 at intnet.mu> wrote:

  I am trying to do so for two main reasons:

  1) This definite integral is a computation for the Hubble parameter. I use the Hubble parameter in a python code to calculate cosmological distances from a given redshift. In order to calculate the conditions when the universe was several seconds old, the redshift must be in the order of 1e+13 and above, up to 1e+43! However, even using such large redshift the conditions become negative or meaningless, if higher precision is not ordered. For me to get a meaningful or positive figure for such large redshifts, I need a minimum of 200 digits accuracy.

  2) My main program to perform these calculations is python with mpmath. Python mpmath has always been very accurate and allow for the computation of larger digits accuracy. However, I?m not so sure with regard to its quadrature module. And so I checked the answer against mathematica (trial version), and the result diverged at about the 186th digit. So I needed a third source to know which one is correct!!!





  Yeah I checked maxima computation of pi, it worked very well for a 1000 digits. But I just don?t know how to use the same precision with regard to any in-built maxima quadrature module.



  I?ve attached the result from mathematica in the file resultmath.docx



  And here is a reproduction of sage or python mpmath result:



mpf('3.37384610380011411639276017299071962336315208512187429308244524692\045408383159261986058700164785239715760980882005113744409027491454736698\265677706897849410300120235641862634820787971501677360673722092085500729\400684840196362348221869360897821068576910702514214008864442443503717684\502197331334033546973')

  The results diverge after the red digits in the above result!



  I?d really appreciate if you could just show me how to compute the tanh-sinh quadrature definite integral of my function with a precision of above 200 digits please!



  Thanks

  Vick






------------------------------------------------------------------------------

  From: macrakis at gmail.com [mailto:macrakis at gmail.com] On Behalf Of Stavros Macrakis
  Sent: Saturday, December 08, 2012 3:52 AM
  To: Vickram Ratnam
  Cc: maxima at math.utexas.edu
  Subject: Re: [Maxima] Hello



  Vickram,



  Thanks for your interest in Maxima.



  What problem are you trying to solve?  i.e. why do you want to calculate a numeric integral to 200 digits of precision in the first place?



  Also, what do you mean by "Maxima cannot compute up to 1e+13!"?   Maxima floating-point numbers have standard IEEE float ranges (up to roughly 1e+308).  Maxima bfloat's have essentially unlimited range  (10^10^100b0 is unproblematic).



  Perhaps if you could show us a self-contained minimal example of how to generate the error you're seeing, we could help find the problem.



            -s


  -- 

  On Fri, Dec 7, 2012 at 12:07 AM, Vickram Ratnam <accts at goldox.mu> wrote:

  Hi,



  I?m new to Maxima. I am using Maxima for windows!



  I?m trying to compute a definite integral using Woollett?s tanh-sinh maxima code and the maxima built-in integration methods but with no success!



  My function is the following:



  1/sqrt((.0000812*(1+x)^4)+(.2719188*(1+x)^3)+(0*(1+x)^2)+.728)



  From 0 to 1e+13



  Using preferably tanh-sinh quadrature and to over 300 digits accuracy!



  I can do the same with python mpmath and on mathematica. I wanted to check the answers from a third source.



  But Maxima cannot compute up to 1e+13!



  Can I do that or is Maxima limited to certain accuracy?



  Thanks

  Vick






  _______________________________________________
  Maxima mailing list
  Maxima at math.utexas.edu
  http://www.math.utexas.edu/mailman/listinfo/maxima







--------------------------------------------------------------------------------
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima