正在加载图片...
238 Chapter 6. Special Functions 1f(x<=2.0){ Polynomial fit. y=x*x/4.0: ans=(-1og(x/2.0)*bessi(0(x))+(-0.57721566+y*(0.42278420 +y*(0.23069756+y*(0.3488590e-1+y*(0.262698e-2 +y*(0.10750e-3+y*0.74e-5)))))); else y=2.0/x; ans=(exp(-x)/sqrt(x))*(1.25331414+y*(-0.7832358e-1 +y*(0.2189568e-1+y*(-0.1062446e-1+y*(0.587872e-2 +y*(-0.251540e-2+y*0.53208e-3)))); return ans; http://www.nr. read able files (including this one) granted fori #include <math.h> float bessi1(float x) .com or call 1-800-872- internet Returns the modified Bessel function /1(x)for any real x. float ax,ans; 7423 double y; Accumulate polynomials in double precision. if ((ax=fabs(x))<3.75){ Polynomial fit y=x/3.75; (North America tusers to make one paper 1988-1992 by Cambridge University Press.Programs from NUMERICAL RECIPES IN THE y*=y; ans=ax*(0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934 +y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3)))) else onty),or y=3.75/ax; ans=0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1 to any server computer,is strictly prohibited. copy for their -y*0.420059e-2); ans=0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2 +y*(0.163801e-2+y*(-0.1031555e-1+y*ans)))): ans *=(exp(ax)/sqrt(ax)) return x 0.0 -ansans; #include <math.h> To order Numerical Recipes books or personaluse.Further reproduction,or 1988-1992 by Numerical Recipes ART OF SCIENTIFIC COMPUTING(ISBN 0-521-43108-5) float bessk1(float x) Returns the modified Bessel function K1(x)for positive real x. float bessi1(float x); double y,ansi Accumulate polynomials in double precision. rsend email to directcustserv@cambridge.org(outside North America) 1f(x<=2.0)[ Polynomial fit. Software. y=x*x/4.0; ans=(1og(x/2.0)*bess11(x)+(1.0/x)*(1.0+y*(0.15443144 +y*(-0.67278579+y*(-0.18156897+y*(-0.1919402e-1 +y*(-0.110404e-2+y*(-0.4686e-4))))))); else y=2.0/x: ans=(exp(-x)/sqrt(x)*(1.25331414+y*(0.23498619 +y*(-0.3655620e-1+y*(0.1504268e-1+y*(-0.780353e-2 +y*(0.325614e-2+y*(-0.68245e-3))))); return ans;238 Chapter 6. Special Functions Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machine￾readable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). if (x <= 2.0) { Polynomial fit. y=x*x/4.0; ans=(-log(x/2.0)*bessi0(x))+(-0.57721566+y*(0.42278420 +y*(0.23069756+y*(0.3488590e-1+y*(0.262698e-2 +y*(0.10750e-3+y*0.74e-5)))))); } else { y=2.0/x; ans=(exp(-x)/sqrt(x))*(1.25331414+y*(-0.7832358e-1 +y*(0.2189568e-1+y*(-0.1062446e-1+y*(0.587872e-2 +y*(-0.251540e-2+y*0.53208e-3)))))); } return ans; } #include <math.h> float bessi1(float x) Returns the modified Bessel function I1(x) for any real x. { float ax,ans; double y; Accumulate polynomials in double precision. if ((ax=fabs(x)) < 3.75) { Polynomial fit. y=x/3.75; y*=y; ans=ax*(0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934 +y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3)))))); } else { y=3.75/ax; ans=0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1 -y*0.420059e-2)); ans=0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2 +y*(0.163801e-2+y*(-0.1031555e-1+y*ans)))); ans *= (exp(ax)/sqrt(ax)); } return x < 0.0 ? -ans : ans; } #include <math.h> float bessk1(float x) Returns the modified Bessel function K1(x) for positive real x. { float bessi1(float x); double y,ans; Accumulate polynomials in double precision. if (x <= 2.0) { Polynomial fit. y=x*x/4.0; ans=(log(x/2.0)*bessi1(x))+(1.0/x)*(1.0+y*(0.15443144 +y*(-0.67278579+y*(-0.18156897+y*(-0.1919402e-1 +y*(-0.110404e-2+y*(-0.4686e-4))))))); } else { y=2.0/x; ans=(exp(-x)/sqrt(x))*(1.25331414+y*(0.23498619 +y*(-0.3655620e-1+y*(0.1504268e-1+y*(-0.780353e-2 +y*(0.325614e-2+y*(-0.68245e-3))))))); } return ans; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有