Note: run make_hyp2f1.m to compile mex files first!
Accurately compute real valued Gauss hypergeometric funciton 2F1(a,b;c;d) using c source files from SciPy.
Much faster than the HYPERGEOM function from symbolic math toolbox. In some cases it is more accurate than HYPERGEOM as well.
Equivalent of scipy.special.hyp2f1()
Tested on a 64-bit windows 7 and 64-bit CentOS 6.3
Siyi Deng (2019). Gauss hypergeometric function (https://www.mathworks.com/matlabcentral/fileexchange/43865-gauss-hypergeometric-function), MATLAB Central File Exchange. Retrieved .
Inspired: HyperGeometric2F1(a, b, z)
Create scripts with code, output, and formatted text in a single executable document.
Asadullah Bhuiyan (view profile)
I am getting an error 'Warning: Error threshold not reached.' for values of b>1/2
Xiaotian Zhu (view profile)
Very fast and accurate! Just wondering will it be possible to control the accuracy threshold (absolute tolerance) so that we can balance the computation precision and speed according the actual need, and maybe provide somewhat control on the numerical stability?
Siyi Deng (view profile)
Liuxing: but it is stated in the introduction that this is "real valued Gauss hypergeometric function".
Liuxing (view profile)
Not support in complex variable.
Jason Nicholson (view profile)
Well done. Thank you for the code. I am using it to build Associated Legendre Functions of fractional order. It is very quick. This is very help to my regression work. It opens the door for me to use Associated Legendre functions of fractional order as basis. This is extremely powerful.
Siyi Deng (view profile)
Junhong YE: I appreciate your feedback, but In the introduction it is stated that this function is for numerical purposes. So isn't it a bit unfair to accuse this function for symbolic computation errors.
Junhong YE (view profile)
For numerical purpose, it works really fast. However, when symbolic computation is invoved, error happens. Though, it's a good work.