sHello everyone,i'm trying to evaluate a function by using the hypergeometric function $$_2F_1(a,b,c,x)$$ .It is implemented in Matlab and you can easily use with the command $$hypergeom([a_1,a_2,...,a_p],[b1,b_2,...,b_q], x)$$ and in my case $$a_1,...a_p,b_1,...,b_q$$ are real number. The problem is that in my calculations I need many decimal places (more than 20), but it prints me maximum default 10 digits with the command hypergeom. I've already tried with the commands 'format long','digits','vpa' but without success, always hypergeom command returns up to 10 digits. Someone can give me some advice in order to get from the 20-30-digit lead in result? Thanks in advance.

  • $\begingroup$ You need Multiple Precision Toolbox to get beyond machine precision in MATLAB. I'm not sure though whether special functions are implemented there. In any case, machine precision (IEEE 754 binary64) is limited to 15 decimal places — more are not guaranteed to round-trip encoding-decoding cycle. Another option is to switch software package: e.g. Wolfram Mathematica has seamless support for arbitrary-precision arithmetic, and most if not all numeric functions are implemented with it in mind. $\endgroup$ – Ruslan Apr 7 '17 at 15:44
  • 1
    $\begingroup$ if you need too much digits, it is not better to try to leave the whole mathematical formulas at a symbolic level and just approximate the last step? $\endgroup$ – Masacroso Apr 7 '17 at 16:01
  • $\begingroup$ The problem is that I can not get to 15 cifredecimali but only 10.....(!?) $\endgroup$ – C.C.12 Apr 7 '17 at 16:03
  • $\begingroup$ If you post a specific set of $(a,b,c,z)$ here I will try it with my own hypergeometric function and let you know what happens. The program I am using is a direct conversion of the corresponding Fortran program in S. Zhang & J. Jin "Computation of Special Functions" (Wiley, 1996). I modified somewhat for increased speed. $\endgroup$ – Cye Waldman Apr 7 '17 at 16:18
  • 1
    $\begingroup$ Follow the advice of @Masocroso and turn to a CAS like Mathematica. It is not in the "philosophy" of Matlab (besides an excellent environment) to have multiple-precision arithmetic for this kind of transcendental functions. Otherwise, you are bound to spend many hours fighting again windmills for nothing/ $\endgroup$ – Jean Marie Apr 7 '17 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.