help with hypergeom() bug
Show older comments
Hello. Matlab's hypergeom() function seems to have some problems. It has difficulty computing hypergeom(a1, [b1 b2], z) for some {a1, b1, b2, z}; for instance, hypergeom(67/2, [69/2 67], -(15^2)) and hypergeom(16.5, [17.5 1530], -12500). I've tried using a symbolic taylor expansion (which involves using the built-in pochhammer function), but this doesn't always solve the problem. If it ever does give a result, the result is not always accurate; for example a=6.5, b=[13 7.5 ], z=-10000. Please help. Thanks. Below is my code
function F_12 = hypergeom1F2(a,b1,b2,z)
syms k
F_12=symsum((z^k)/sym('k!')*(pochhammer(a,k)/pochhammer(b1,k)/pochhammer(b2,k)), k, 0, Inf);
2 Comments
Walter Roberson
on 26 May 2015
That is an appropriate symbolic formula for hypergeom([a],[b1,b2],z). Keep in mind though that symsum is going to recognize it as that and is going to convert it to a hypergeom() call, so if the hypergeom() call itself is getting the wrong answer, the symsum will get the wrong answer.
I do not have the MATLAB Symbolic Toolbox to test with. What results is it giving for the hypergeom calls?
Walter Roberson
on 26 May 2015
Answers (0)
Categories
Find more on Code Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!