# Improve the precision of the Whittaker function?

Posted 2 months ago
330 Views
|
4 Replies
|
3 Total Likes
|
 mu = -0.1; beta = -0.5; sigma = 2.5; a = 90; b = 120; m = -1/(4*beta); m1 = m - 1/2; a1 = mu/(sigmasigmabeta)a^(-2beta); b1 = mu/(sigmasigmabeta)b^(-2beta); MyF[k_] := Gamma[ m - k](WhittakerW[k, m1, b1]WhittakerM[k, m1, a1] - WhittakerM[k, m1, b1]*WhittakerW[k, m1, a1]); this code MyF[1000]=0. But for this code: MyF1[k_] := N[ Gamma[Rationalize[ m - k]](WhittakerM[Rationalize[k], 0, Rationalize[a1]] WhittakerW[Rationalize[k], 0, Rationalize[b1]] - WhittakerM[Rationalize[k], 0, Rationalize[b1]] WhittakerW[ Rationalize[k], 0, Rationalize[a1]]), 5]; MyF1[1000]=0.044810; 
4 Replies
Sort By:
Posted 2 months ago
 Do the computation with exact numbers: mu = -1/10; beta = -1/2; sigma = 2 + 1/2; and turn to floating points only at the very end: In[7]:= N[MyF[1000], 5] Out[7]= 0.044810 Your first computation works with machine numbers, which are not enough.
Posted 2 months ago
 I want to find all roots of the function MyF[k]. and do you know how to do it?
 Try https://reference.wolfram.com/language/ref/FindRoot.html with WorkingPrecision -> 20
 mu=-0.1; beta=-0.5; sigma=2.5; (* Add this line to manipulate precision *) {mu,beta,sigma}=SetPrecision[{mu,beta,sigma},20]; a=90; b=120; m=-1/(4*beta);m1=m-1/2; a1=mu/(sigma*sigma*beta)a^(-2beta); b1=mu/(sigma*sigma*beta)b^(-2beta); MyF[k_]:=Gamma[m-k](WhittakerW[k,m1,b1]WhittakerM[k,m1,a1]-WhittakerM[k,m1,b1]*WhittakerW[k,m1,a1]); The result is MyF[1000]//Chop ==> 0.0448100417591471632 Link to documentation: